blob: e292a1d0fd6adf105abcd058e58aec4685b4c83b [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{{( protected)?}} void @upcast_test(%C6upcast1D** nocapture dereferenceable({{.*}})) {{.*}} {
// CHECK: entry:
// CHECK-NEXT: bitcast %C6upcast1D** {{%[0-0]+}} to %C6upcast1C**
// 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 : $()
}