Files
swift-mirror/test/IRGen/section_structs_generic.swift
Daniel Rodríguez Troitiño ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00

47 lines
2.0 KiB
Swift

// RUN: %target-swift-frontend -enable-experimental-feature SymbolLinkageMarkers -parse-as-library -emit-ir %s -o - | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: swift_feature_SymbolLinkageMarkers
struct MyStruct1<T> {
var a, b: T
}
@_section("__TEXT,__mysection") var g_MyStruct1 = MyStruct1<Int>(a: 42, b: 66)
struct MyStruct2<T> {
var a: T
var b: (T, T)
}
@_section("__TEXT,__mysection") var g_MyStruct2 = MyStruct2<Int>(a: 42, b: (66, 67))
struct MyStruct3<T> {
var a, b: T
public init(a: T, b: T) {
self.a = a
self.b = b
}
}
@_section("__TEXT,__mysection") var g_MyStruct3 = MyStruct3<Int>(a: 42, b: 77)
struct MyStruct4<T> {
var a: T
var s: MyStruct1<T>
}
@_section("__TEXT,__mysection") var g_MyStruct4 = MyStruct4<Int>(a: 42, s: MyStruct1<Int>(a: 43, b: 44))
struct MyStruct5<T> {
var q: MyStruct4<T>
var r: MyStruct4<T>
public init(q: MyStruct4<T>, r: MyStruct4<T>) {
self.q = q
self.r = r
}
}
@_section("__TEXT,__mysection") var g_MyStruct5 = MyStruct5<Int>(q: MyStruct4<Int>(a: 42, s: MyStruct1<Int>(a: 43, b: 44)), r: MyStruct4<Int>(a: 42, s: MyStruct1<Int>(a: 43, b: 44)))
// CHECK: @"{{.*}}g_MyStruct1{{.*}}Gvp" = hidden global {{.*}} <{ %TSi <{ {{(i32|i64)}} 42 }>, %TSi <{ {{(i32|i64)}} 66 }> }>
// CHECK: @"{{.*}}g_MyStruct2{{.*}}Gvp" = hidden global {{.*}} <{ %TSi <{ {{(i32|i64)}} 42 }>, <{ %TSi, %TSi }> <{ %TSi <{ {{(i32|i64)}} 66 }>, %TSi <{ {{(i32|i64)}} 67 }> }> }>
// CHECK: @"{{.*}}g_MyStruct3{{.*}}Gvp" = hidden global {{.*}} <{ %TSi <{ {{(i32|i64)}} 42 }>, %TSi <{ {{(i32|i64)}} 77 }> }>
// CHECK: @"{{.*}}g_MyStruct4{{.*}}Gvp" = hidden global {{.*}} <{ %TSi <{ {{(i32|i64)}} 42 }>, {{.*}} <{ %TSi <{ {{(i32|i64)}} 43 }>, %TSi <{ {{(i32|i64)}} 44 }> }> }>
// CHECK: @"{{.*}}g_MyStruct5{{.*}}Gvp" = hidden global {{.*}} <{ {{.*}} <{ %TSi <{ {{(i32|i64)}} 42 }>, {{.*}} <{ %TSi <{ {{(i32|i64)}} 43 }>, %TSi <{ {{(i32|i64)}} 44 }> }> }>, {{.*}} <{ %TSi <{ {{(i32|i64)}} 42 }>, {{.*}} <{ %TSi <{ {{(i32|i64)}} 43 }>, %TSi <{ {{(i32|i64)}} 44 }> }> }> }>