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
14
struct MyStruct {
15
- @_section ( " __TEXT ,__mysection" ) static var static0 : Int = 1
15
+ @_section ( " __DATA ,__mysection" ) static var static0 : Int = 1
16
16
@_section ( " __TEXT,__mysection " ) func foo( ) { }
17
17
}
18
18
19
- // SIL: @_section("__TEXT ,__mysection") @_hasStorage @_hasInitialValue var g0: Int { get set }
20
- // SIL: @_section("__TEXT ,__mysection") @_hasStorage @_hasInitialValue var g1: (Int, Int) { get set }
21
- // SIL: @_section("__TEXT ,__mysection") @_hasStorage @_hasInitialValue var g2: Bool { get set }
22
- // SIL: @_section("__TEXT ,__mysection") @_hasStorage @_hasInitialValue public var g3: Bool { get set }
23
- // SIL: @_section("__TEXT ,__mysection") @_hasStorage @_hasInitialValue var g4: UnsafeMutablePointer<Int>? { get set }
24
- // SIL: @_section("__TEXT ,__mysection") @_hasStorage @_hasInitialValue var g5: UnsafeMutablePointer<Int>? { get set }
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 }
25
25
// SIL: @_section("__TEXT,__mysection") func foo()
26
26
// SIL: struct MyStruct {
27
- // SIL: @_section("__TEXT ,__mysection") @_hasStorage @_hasInitialValue static var static0: Int { get set }
27
+ // SIL: @_section("__DATA ,__mysection") @_hasStorage @_hasInitialValue static var static0: Int { get set }
28
28
// SIL: @_section("__TEXT,__mysection") func foo()
29
29
30
30
// SIL: sil private [global_init_once_fn] @$s7section2g0_WZ : $@convention(c)
@@ -44,12 +44,12 @@ struct MyStruct {
44
44
// SIL: sil hidden [global_init] @$s7section8MyStructV7static0Sivau : $@convention(thin)
45
45
// SIL: sil hidden [section "__TEXT,__mysection"] @$s7section8MyStructV3fooyyF : $@convention(method)
46
46
47
- // IR: @"$s7section2g0Sivp" = hidden global %TSi <{ {{(i64|i32)}} 1 }>, section "__TEXT ,__mysection"
48
- // IR: @"$s7section2g1Si_Sitvp" = hidden global <{ %TSi, %TSi }> <{ %TSi <{ {{(i64|i32)}} 42 }>, %TSi <{ {{(i64|i32)}} 43 }> }>, section "__TEXT ,__mysection"
49
- // IR: @"$s7section2g2Sbvp" = hidden global %TSb <{ i1 true }>, section "__TEXT ,__mysection"
50
- // IR: @"$s7section2g3Sbvp" = {{.*}}global %TSb <{ i1 true }>, section "__TEXT ,__mysection"
51
- // IR: @"$s7section2g4SpySiGSgvp" = hidden global {{i64|i32}} 0, section "__TEXT ,__mysection"
52
- // IR: @"$s7section2g5SpySiGSgvp" = hidden global {{i64|i32}} 1111638594, section "__TEXT ,__mysection"
53
- // IR: @"$s7section8MyStructV7static0SivpZ" = hidden global %TSi <{ {{(i64|i32)}} 1 }>, 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"
54
54
// IR: define {{.*}}@"$s7section3fooyyF"(){{.*}} section "__TEXT,__mysection"
55
55
// IR: define {{.*}}@"$s7section8MyStructV3fooyyF"() #0 section "__TEXT,__mysection"
0 commit comments