mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
47 lines
1.3 KiB
Swift
47 lines
1.3 KiB
Swift
// RUN: %target-swift-frontend -emit-ir -primary-file %s -enable-experimental-feature TupleConformances -parse-as-library | %FileCheck %s
|
|
|
|
// REQUIRES: swift_feature_TupleConformances
|
|
|
|
protocol P {
|
|
func defaultRequirement()
|
|
static func staticRequirement()
|
|
}
|
|
|
|
extension P {
|
|
func defaultRequirement() {}
|
|
}
|
|
|
|
typealias Tuple<each Element> = (repeat each Element)
|
|
|
|
extension Tuple: P where repeat each Element: P {
|
|
static func staticRequirement() {}
|
|
}
|
|
|
|
func takesP<T: P>(_ t: T) {
|
|
t.defaultRequirement()
|
|
T.staticRequirement()
|
|
}
|
|
|
|
struct S: P {
|
|
static func staticRequirement() {
|
|
print(self)
|
|
}
|
|
}
|
|
|
|
func use() {
|
|
takesP(())
|
|
takesP((S(), S()))
|
|
}
|
|
|
|
// CHECK-LABEL: define internal swiftcc void @"$sxxQp_t18tuple_conformances1PA2aBP18defaultRequirementyyFTW"(ptr {{.*}} swiftself %0, ptr %Self, ptr %SelfWitnessTable) {{.*}} {
|
|
|
|
// CHECK-LABEL: define internal swiftcc void @"$sxxQp_t18tuple_conformances1PA2aBP17staticRequirementyyFZTW"(ptr swiftself %0, ptr %Self, ptr %SelfWitnessTable) {{.*}} {
|
|
|
|
// CHECK-LABEL: define hidden swiftcc void @"$s18tuple_conformances3useyyF"() {{.*}} {
|
|
// CHECK: call ptr @"$s18tuple_conformances1SV_ACtxxQp_tAA1PAAWl"()
|
|
// CHECK: ret void
|
|
|
|
// CHECK-LABEL: define linkonce_odr hidden ptr @"$s18tuple_conformances1SV_ACtxxQp_tAA1PAAWl"() {{.*}} {
|
|
|
|
|