Files
swift-mirror/test/IRGen/upcast.sil
2019-08-15 14:57:24 -07:00

21 lines
571 B
Plaintext

// 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({{.*}}) %0) {{.*}} {
// 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 : $()
}