mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This prevents the linker from trying to emit relative relocations to locally-defined public symbols into dynamic libraries, which gives ld.so heartache.
62 lines
1.4 KiB
Plaintext
62 lines
1.4 KiB
Plaintext
// RUN: %swift -target i386-apple-ios7 %s -gnone -emit-ir | FileCheck %s
|
|
// RUN: %swift -target armv7-apple-ios7 %s -gnone -emit-ir | FileCheck %s
|
|
|
|
// REQUIRES: X86
|
|
// REQUIRES: ARM
|
|
|
|
// Check that we correctly lay out single-payload enums with a class reference
|
|
// payload as nullable pointers. <rdar://problem/16093103>
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
|
|
class C {}
|
|
sil_vtable C {}
|
|
|
|
sil @_TFC11enum_32_bit1CD : $@convention(thin) (@owned C) -> ()
|
|
|
|
// CHECK-LABEL: %O11enum_32_bit3Foo = type <{ [4 x i8] }>
|
|
enum Foo {
|
|
case A(C)
|
|
case B
|
|
}
|
|
|
|
@objc protocol ClassExistential {}
|
|
|
|
// CHECK-LABEL: %O11enum_32_bit3Bar = type <{ [4 x i8] }>
|
|
enum Bar {
|
|
case A(ClassExistential)
|
|
case B
|
|
}
|
|
|
|
// CHECK-LABEL: %O11enum_32_bit3Bas = type <{ [4 x i8] }>
|
|
enum Bas {
|
|
case A(ClassExistential)
|
|
case B(C)
|
|
case Z
|
|
}
|
|
|
|
// CHECK-LABEL: define{{( protected)?}} void @foo(i32)
|
|
sil @foo : $@convention(thin) (@owned Foo) -> () {
|
|
entry(%0 : $Foo):
|
|
return undef : $()
|
|
}
|
|
|
|
// CHECK-LABEL: define{{( protected)?}} void @bar(i32)
|
|
sil @bar : $@convention(thin) (@owned Bar) -> () {
|
|
entry(%0 : $Bar):
|
|
return undef : $()
|
|
}
|
|
|
|
// CHECK-LABEL: define{{( protected)?}} void @bas(i32)
|
|
sil @bas : $@convention(thin) (@owned Bas) -> () {
|
|
entry(%0 : $Bas):
|
|
return undef : $()
|
|
}
|
|
|
|
// Force instantiation of the IR types
|
|
sil @indirect_foo : $@convention(thin) (@in Foo) -> ()
|
|
sil @indirect_bar : $@convention(thin) (@in Bar) -> ()
|
|
sil @indirect_bas : $@convention(thin) (@in Bas) -> ()
|