blob: 947a3ced5eeb567180a4de6fc5f25eb8f5568e08 [file] [log] [blame]
// RUN: %target-swift-frontend %s -emit-ir | %FileCheck %s
// Make sure that we are able to lower upcast addresses.
// CHECK-LABEL: define{{( dllexport)?}}{{( 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 : $()
}