mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
21 lines
571 B
Plaintext
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 : $()
|
|
}
|