|
3 | 3 |
|
4 | 4 | // REQUIRES: swift_in_compiler
|
5 | 5 |
|
6 |
| -@_section("__TEXT,__mysection") var g0: Int = 1 |
7 |
| -@_section("__TEXT,__mysection") var g1: (Int, Int) = (42, 43) |
8 |
| -@_section("__TEXT,__mysection") var g2: Bool = true |
9 |
| -@_section("__TEXT,__mysection") public var g3: Bool = true |
10 |
| -@_section("__TEXT,__mysection") var g4: UnsafeMutablePointer<Int>? = nil |
11 |
| -@_section("__TEXT,__mysection") var g5: UnsafeMutablePointer<Int>? = UnsafeMutablePointer(bitPattern: 0x42424242) |
| 6 | +@_section("__DATA,__mysection") var g0: Int = 1 |
| 7 | +@_section("__DATA,__mysection") var g1: (Int, Int) = (42, 43) |
| 8 | +@_section("__DATA,__mysection") var g2: Bool = true |
| 9 | +@_section("__DATA,__mysection") public var g3: Bool = true |
| 10 | +@_section("__DATA,__mysection") var g4: UnsafeMutablePointer<Int>? = nil |
| 11 | +@_section("__DATA,__mysection") var g5: UnsafeMutablePointer<Int>? = UnsafeMutablePointer(bitPattern: 0x42424242) |
12 | 12 | @_section("__TEXT,__mysection") func foo() {}
|
13 | 13 |
|
14 |
| -// SIL: @_section("__TEXT,__mysection") @_hasStorage @_hasInitialValue var g0: Int { get set } |
15 |
| -// SIL: @_section("__TEXT,__mysection") @_hasStorage @_hasInitialValue var g1: (Int, Int) { get set } |
16 |
| -// SIL: @_section("__TEXT,__mysection") @_hasStorage @_hasInitialValue var g2: Bool { get set } |
17 |
| -// SIL: @_section("__TEXT,__mysection") @_hasStorage @_hasInitialValue public var g3: Bool { get set } |
18 |
| -// SIL: @_section("__TEXT,__mysection") @_hasStorage @_hasInitialValue var g4: UnsafeMutablePointer<Int>? { get set } |
19 |
| -// SIL: @_section("__TEXT,__mysection") @_hasStorage @_hasInitialValue var g5: UnsafeMutablePointer<Int>? { get set } |
| 14 | +struct MyStruct { |
| 15 | + @_section("__DATA,__mysection") static var static0: Int = 1 |
| 16 | + @_section("__TEXT,__mysection") func foo() {} |
| 17 | +} |
| 18 | + |
| 19 | +// SIL: @_section("__DATA,__mysection") @_hasStorage @_hasInitialValue var g0: Int { get set } |
| 20 | +// SIL: @_section("__DATA,__mysection") @_hasStorage @_hasInitialValue var g1: (Int, Int) { get set } |
| 21 | +// SIL: @_section("__DATA,__mysection") @_hasStorage @_hasInitialValue var g2: Bool { get set } |
| 22 | +// SIL: @_section("__DATA,__mysection") @_hasStorage @_hasInitialValue public var g3: Bool { get set } |
| 23 | +// SIL: @_section("__DATA,__mysection") @_hasStorage @_hasInitialValue var g4: UnsafeMutablePointer<Int>? { get set } |
| 24 | +// SIL: @_section("__DATA,__mysection") @_hasStorage @_hasInitialValue var g5: UnsafeMutablePointer<Int>? { get set } |
20 | 25 | // SIL: @_section("__TEXT,__mysection") func foo()
|
| 26 | +// SIL: struct MyStruct { |
| 27 | +// SIL: @_section("__DATA,__mysection") @_hasStorage @_hasInitialValue static var static0: Int { get set } |
| 28 | +// SIL: @_section("__TEXT,__mysection") func foo() |
| 29 | + |
21 | 30 | // SIL: sil private [global_init_once_fn] @$s7section2g0_WZ : $@convention(c)
|
22 | 31 | // SIL: sil hidden [global_init] @$s7section2g0Sivau : $@convention(thin)
|
23 | 32 | // SIL: sil private [global_init_once_fn] @$s7section2g1_WZ : $@convention(c)
|
|
31 | 40 | // SIL: sil private [global_init_once_fn] @$s7section2g5_WZ : $@convention(c)
|
32 | 41 | // SIL: sil hidden [global_init] @$s7section2g5SpySiGSgvau : $@convention(thin)
|
33 | 42 | // SIL: sil hidden [section "__TEXT,__mysection"] @$s7section3fooyyF : $@convention(thin)
|
| 43 | +// SIL: sil private [global_init_once_fn] @$s7section8MyStructV7static0_WZ : $@convention(c) |
| 44 | +// SIL: sil hidden [global_init] @$s7section8MyStructV7static0Sivau : $@convention(thin) |
| 45 | +// SIL: sil hidden [section "__TEXT,__mysection"] @$s7section8MyStructV3fooyyF : $@convention(method) |
34 | 46 |
|
35 |
| -// IR: @"$s7section2g0_Wz" = internal global {{(i64|i32)}} 0 |
36 |
| -// IR: @"$s7section2g0Sivp" = hidden global %TSi <{ {{(i64|i32)}} 1 }>, section "__TEXT,__mysection" |
37 |
| -// IR: @"$s7section2g1_Wz" = internal global {{(i64|i32)}} 0 |
38 |
| -// IR: @"$s7section2g1Si_Sitvp" = hidden global <{ %TSi, %TSi }> <{ %TSi <{ {{(i64|i32)}} 42 }>, %TSi <{ {{(i64|i32)}} 43 }> }>, section "__TEXT,__mysection" |
39 |
| -// IR: @"$s7section2g2_Wz" = internal global {{(i64|i32)}} 0 |
40 |
| -// IR: @"$s7section2g2Sbvp" = hidden global %TSb <{ i1 true }>, section "__TEXT,__mysection" |
41 |
| -// IR: @"$s7section2g3_Wz" = internal global {{(i64|i32)}} 0 |
42 |
| -// IR: @"$s7section2g3Sbvp" = {{.*}}global %TSb <{ i1 true }>, section "__TEXT,__mysection" |
43 |
| -// IR: @"$s7section2g4_Wz" = internal global {{i64|i32}} 0 |
44 |
| -// IR: @"$s7section2g4SpySiGSgvp" = hidden global {{i64|i32}} 0, section "__TEXT,__mysection" |
45 |
| -// IR: @"$s7section2g5_Wz" = internal global {{i64|i32}} 0 |
46 |
| -// IR: @"$s7section2g5SpySiGSgvp" = hidden global {{i64|i32}} 1111638594, section "__TEXT,__mysection" |
| 47 | +// IR: @"$s7section2g0Sivp" = hidden global %TSi <{ {{(i64|i32)}} 1 }>, section "__DATA,__mysection" |
| 48 | +// IR: @"$s7section2g1Si_Sitvp" = hidden global <{ %TSi, %TSi }> <{ %TSi <{ {{(i64|i32)}} 42 }>, %TSi <{ {{(i64|i32)}} 43 }> }>, section "__DATA,__mysection" |
| 49 | +// IR: @"$s7section2g2Sbvp" = hidden global %TSb <{ i1 true }>, section "__DATA,__mysection" |
| 50 | +// IR: @"$s7section2g3Sbvp" = {{.*}}global %TSb <{ i1 true }>, section "__DATA,__mysection" |
| 51 | +// IR: @"$s7section2g4SpySiGSgvp" = hidden global {{i64|i32}} 0, section "__DATA,__mysection" |
| 52 | +// IR: @"$s7section2g5SpySiGSgvp" = hidden global {{i64|i32}} 1111638594, section "__DATA,__mysection" |
| 53 | +// IR: @"$s7section8MyStructV7static0SivpZ" = hidden global %TSi <{ {{(i64|i32)}} 1 }>, section "__DATA,__mysection" |
47 | 54 | // IR: define {{.*}}@"$s7section3fooyyF"(){{.*}} section "__TEXT,__mysection"
|
| 55 | +// IR: define {{.*}}@"$s7section8MyStructV3fooyyF"() #0 section "__TEXT,__mysection" |
0 commit comments