| // RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil %s -emit-ir | %FileCheck %s |
| |
| // Make sure that we are able to lower upcast addresses. |
| |
| // CHECK-LABEL: define{{( protected)?}} swiftcc void @upcast_test(%T6upcast1DC** nocapture dereferenceable({{.*}})) {{.*}} { |
| // CHECK: entry: |
| // CHECK-NEXT: bitcast %T6upcast1DC** {{%[0-0]+}} to %T6upcast1CC** |
| // CHECK-NEXT: ret void |
| |
| class C {} |
| sil_vtable C {} |
| class D : C {} |
| sil_vtable D {} |
| |
| sil @upcast_test : $@convention(thin) (@inout D) -> () { |
| bb0(%0 : $*D): |
| %1 = upcast %0 : $*D to $*C |
| %33 = tuple() |
| return %33 : $() |
| } |