Skip to content

Commit 5094804

Browse files
Merge pull request #60506 from AnthonyLatsis/migrate-test-suite-to-gh-issues-1
Gardening: Migrate test suite to GH issues p. 1
2 parents accc282 + 85fae6b commit 5094804

20 files changed

+278
-242
lines changed

test/api-digester/stability-concurrency-abi.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)
4141

42-
// SR-13362
42+
// https://github.com/apple/swift/issues/55803
4343
// We currently only have a baseline for Intel CPUs on macOS.
4444
// REQUIRES: OS=macosx
4545
// REQUIRES: CPU=x86_64

test/api-digester/stability-stdlib-abi-with-array-cow-checks.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)
4747

48-
// SR-13362
48+
// https://github.com/apple/swift/issues/55803
4949
// We currently only have a baseline for Intel CPUs on macOS.
5050
// REQUIRES: OS=macosx
5151
// REQUIRES: CPU=x86_64

test/api-digester/stability-stdlib-abi-with-asserts.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)
4545

46-
// SR-13362
46+
// https://github.com/apple/swift/issues/55803
4747
// We currently only have a baseline for Intel CPUs on macOS.
4848
// REQUIRES: OS=macosx
4949
// REQUIRES: CPU=x86_64

test/api-digester/stability-stdlib-abi-without-asserts.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)
3939

40-
// SR-13362
40+
// https://github.com/apple/swift/issues/55803
4141
// We currently only have a baseline for Intel CPUs on macOS.
4242
// REQUIRES: OS=macosx && CPU=x86_64
4343

test/api-digester/stability-stdlib-source.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: OS=macosx
22

3-
// SR-13362
3+
// https://github.com/apple/swift/issues/55803
44
// This currently fails on non-Intel architectures due to no baseline being
55
// available and it is not possible to filter across architectures in the
66
// output.

test/attr/accessibility_proto.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ public struct NonPublicMemberwiseInitStruct: PublicInitProto {
105105
public var value: Int
106106
}
107107

108-
// SR-15273
108+
// https://github.com/apple/swift/issues/57595
109+
109110
public protocol PublicEmptyInit {
110111
init()
111112
}

test/attr/attr_autoclosure.swift

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,17 @@ func rdar_20591571() {
207207
}
208208
}
209209

210-
// rdar://problem/30906031 - [SR-4188]: withoutActuallyEscaping doesn't accept an @autoclosure argument
210+
/// rdar://problem/30906031 [https://github.com/apple/swift/issues/46771]
211+
/// `withoutActuallyEscaping` doesn't accept an @autoclosure argument
212+
211213
func rdar_30906031(in arr: [Int], fn: @autoclosure () -> Int) -> Bool {
212214
return withoutActuallyEscaping(fn) { escapableF in // Ok
213215
arr.lazy.filter { $0 >= escapableF() }.isEmpty
214216
}
215217
}
216218

217-
// SR-2688
219+
// https://github.com/apple/swift/issues/45293
220+
218221
class Foo {
219222
typealias FooClosure = () -> String
220223
func fooFunction(closure: @autoclosure FooClosure) {} // ok
@@ -282,19 +285,22 @@ func test_autoclosure_with_generic_argument_mismatch() {
282285
foo(S<String>()) // expected-error {{cannot convert value of type 'S<String>' to expected argument type 'S<Int>'}}
283286
}
284287

285-
// SR-11934
286-
func sr_11934(_ x: @autoclosure String...) {} // expected-error {{'@autoclosure' must not be used on variadic parameters}}
288+
// https://github.com/apple/swift/issues/54353
289+
290+
func f_54353(_ x: @autoclosure String...) {} // expected-error {{'@autoclosure' must not be used on variadic parameters}}
291+
292+
// https://github.com/apple/swift/issues/54357
293+
294+
let _: Array<@autoclosure String> = [] // expected-error {{'@autoclosure' may only be used on parameters}}
295+
func f1_54357() -> @autoclosure String {} // expected-error {{'@autoclosure' may only be used on parameters}}
296+
func f2_54357(_ x: [@autoclosure String]) {} // expected-error {{'@autoclosure' may only be used on parameters}}
287297

288-
// SR-11938
289-
let sr_11938_1: Array<@autoclosure String> = [] // expected-error {{'@autoclosure' may only be used on parameters}}
290-
func sr_11938_2() -> @autoclosure String { "" } // expected-error {{'@autoclosure' may only be used on parameters}}
291-
func sr_11938_3(_ x: [@autoclosure String]) {} // expected-error {{'@autoclosure' may only be used on parameters}}
298+
protocol P_54357 {}
299+
struct S_54357 : @autoclosure P_54357 {} // expected-error {{'@autoclosure' may only be used on parameters}}
292300

293-
protocol SR_11938_P {}
294-
struct SR_11938_S : @autoclosure SR_11938_P {} // expected-error {{'@autoclosure' may only be used on parameters}}
301+
// https://github.com/apple/swift/issues/51669
295302

296-
// SR-9178
297-
func bar<T>(_ x: @autoclosure T) {} // expected-error 1{{@autoclosure attribute only applies to function types}}
303+
func f_51669<T>(_ x: @autoclosure T) {} // expected-error 1{{@autoclosure attribute only applies to function types}}
298304

299305
func test_autoclosure_type_in_parens() {
300306
let _: (@autoclosure (() -> Void)) -> Void = { _ in } // Ok

test/attr/attr_availability.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,15 +1056,17 @@ class SubInheritedDeprecatedInit: BaseDeprecatedInit { }
10561056

10571057
_ = SubInheritedDeprecatedInit(bad: 0) // expected-warning {{'init(bad:)' is deprecated}}
10581058

1059+
// https://github.com/apple/swift/issues/51149
10591060
// Should produce no warnings.
1060-
enum SR8634_Enum: Int {
1061+
1062+
enum Enum_51149: Int {
10611063
case a
10621064
@available(*, deprecated, message: "I must not be raised in synthesized code")
10631065
case b
10641066
case c
10651067
}
10661068

1067-
struct SR8634_Struct: Equatable {
1069+
struct Struct_51149: Equatable {
10681070
@available(*, deprecated, message: "I must not be raised in synthesized code", renamed: "x")
10691071
let a: Int
10701072
}

test/attr/attr_convention.swift

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,30 @@ let f4c: @convention(c, cType: "int (*)(int)") (Int32) -> Int32 = { $0 }
1111

1212
let f5: @convention(INTERCAL) (Int) -> Int = { $0 } // expected-error{{convention 'INTERCAL' not supported}}
1313

14-
// SR-11027
14+
// https://github.com/apple/swift/issues/53417
1515

16-
func sr11027(_ f: @convention(block) @autoclosure () -> Int) -> Void {} // expected-error {{'@convention(block)' attribute is not allowed on '@autoclosure' types}}
17-
sr11027(1)
16+
do {
17+
func block(_ f: @convention(block) @autoclosure () -> Int) -> Void {} // expected-error {{'@convention(block)' attribute is not allowed on '@autoclosure' types}}
18+
block(1)
1819

19-
func sr11027_c(_ f: @convention(c) @autoclosure () -> Int) -> Void {} // expected-error{{'@convention(c)' attribute is not allowed on '@autoclosure' types}}
20-
sr11027_c(1)
20+
func c(_ f: @convention(c) @autoclosure () -> Int) -> Void {} // expected-error{{'@convention(c)' attribute is not allowed on '@autoclosure' types}}
21+
c(1)
2122

22-
func sr11027_swift(_ f: @convention(swift) @autoclosure () -> Int) -> Void {} // OK
23-
sr11027_swift(1)
23+
func swift(_ f: @convention(swift) @autoclosure () -> Int) -> Void {} // OK
24+
swift(1)
2425

25-
func sr11027_thin(_ f: @convention(thin) @autoclosure () -> Int) -> Void {} // OK
26-
sr11027_thin(1)
26+
func thin(_ f: @convention(thin) @autoclosure () -> Int) -> Void {} // OK
27+
thin(1)
2728

28-
func sr11027_2(_ f: @autoclosure @convention(block) () -> Int) -> Void {} // expected-error {{'@convention(block)' attribute is not allowed on '@autoclosure' types}}
29-
sr11027_2(1)
29+
func block2(_ f: @autoclosure @convention(block) () -> Int) -> Void {} // expected-error {{'@convention(block)' attribute is not allowed on '@autoclosure' types}}
30+
block2(1)
3031

31-
func sr11027_c_2(_ f: @autoclosure @convention(c) () -> Int) -> Void {} // expected-error {{'@convention(c)' attribute is not allowed on '@autoclosure' types}}
32-
sr11027_c_2(1)
32+
func c2(_ f: @autoclosure @convention(c) () -> Int) -> Void {} // expected-error {{'@convention(c)' attribute is not allowed on '@autoclosure' types}}
33+
c2(1)
3334

34-
func sr11027_swift_2(_ f: @autoclosure @convention(swift) () -> Int) -> Void {} // OK
35-
sr11027_swift_2(1)
35+
func swift2(_ f: @autoclosure @convention(swift) () -> Int) -> Void {} // OK
36+
swift2(1)
3637

37-
func sr11027_thin_2(_ f: @autoclosure @convention(thin) () -> Int) -> Void {} // OK
38-
sr11027_thin_2(1)
38+
func thin2(_ f: @autoclosure @convention(thin) () -> Int) -> Void {} // OK
39+
thin2(1)
40+
}

test/attr/attr_discardableResult.swift

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,26 @@ func testOptionalChaining(c1: C1?, s1: S1?) {
180180
s1!.f2Optional() // expected-warning {{result of call to 'f2Optional()' is unused}}
181181
}
182182

183-
@discardableResult func SR2948 (_ closure: @escaping ()->()) -> (()->()) {
183+
// https://github.com/apple/swift/issues/45542
184+
185+
@discardableResult func f_45542(_ closure: @escaping ()->()) -> (()->()) {
184186
closure()
185187
return closure
186188
}
187-
SR2948({}) // okay
188-
189-
class SR7562_A {
190-
@discardableResult required init(input: Int) { }
189+
do {
190+
f_45542({}) // okay
191191
}
192192

193-
class SR7562_B : SR7562_A {}
193+
// https://github.com/apple/swift/issues/50104
194194

195-
SR7562_A(input: 10) // okay
196-
SR7562_B(input: 10) // okay
195+
class C1_50104 {
196+
@discardableResult required init(input: Int) { }
197+
}
198+
class C2_50104 : C1_50104 {}
199+
do {
200+
C1_50104(input: 10) // okay
201+
C2_50104(input: 10) // okay
202+
}
197203

198204
protocol FooProtocol {}
199205

@@ -223,9 +229,9 @@ class Discard {
223229
}
224230
}
225231

226-
// SR-12271
232+
// https://github.com/apple/swift/issues/54699
227233

228-
struct SR_12271_S {
234+
struct S_54699 {
229235
@discardableResult
230236
func bar1() -> () -> Void {
231237
return {}
@@ -236,9 +242,9 @@ struct SR_12271_S {
236242
return {}
237243
}
238244
}
239-
240-
SR_12271_S().bar1() // Okay
241-
SR_12271_S.bar2() // Okay
242-
243-
SR_12271_S().bar1 // expected-error {{function is unused}}
244-
SR_12271_S.bar2 // expected-error {{function is unused}}
245+
do {
246+
S_54699().bar1() // Okay
247+
S_54699.bar2() // Okay
248+
S_54699().bar1 // expected-error {{function is unused}}
249+
S_54699.bar2 // expected-error {{function is unused}}
250+
}

test/attr/attr_dynamic.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class InheritsDynamic: Foo {
5454
override func notDynamic() {}
5555
}
5656

57-
// SR-5317
57+
// https://github.com/apple/swift/issues/47892
58+
5859
@objcMembers
5960
class ObjCMemberCheck {
6061
dynamic var s = NotObjCAble(c: Foo())

test/attr/attr_dynamic_callable.swift

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -442,21 +442,21 @@ func testArchetypeType5<T, C : CallableGeneric5<T>>(a: C) -> Double {
442442
return a(1, 2, 3) + a(x1: 1, 2, x3: 3)
443443
}
444444

445-
// SR-9239 Default argument in initializer
445+
// https://github.com/apple/swift/issues/51727
446+
// Default argument in initializer
446447

447448
@dynamicCallable
448-
struct A {
449+
struct S_51727 {
449450
init(_ x: Int = 0) {}
450451
func dynamicallyCall(withArguments args: [Int]) {}
451452
}
452-
453-
func test9239() {
454-
A()() // ok
453+
do {
454+
S_51727()() // ok
455455
}
456456

457-
// SR-10313
457+
// https://github.com/apple/swift/issues/52713
458458
//
459-
// Modified version of the code snippet in the SR to not crash.
459+
// Modified version of the code snippet in the issue report to not crash.
460460

461461
struct MissingKeyError: Error {}
462462

@@ -471,56 +471,59 @@ class DictionaryBox {
471471
return value
472472
}
473473
}
474-
475-
func test10313() {
474+
do {
476475
let box = DictionaryBox()
477476
box.dictionary["bool"] = false
478477
let _: Bool = try! box("bool") // ok
479478
}
480479

481-
// SR-10753
480+
// https://github.com/apple/swift/issues/53143
482481

483482
@dynamicCallable
484-
struct B {
483+
struct S_53143 {
485484
public func dynamicallyCall(withArguments arguments: [String]) {}
486485
}
486+
do {
487+
S_53143()("hello") // ok
488+
S_53143()("\(1)") // ok
489+
}
487490

488-
B()("hello") // ok
489-
B()("\(1)") // ok
491+
// https://github.com/apple/swift/issues/54456
490492

491-
// SR-12019
492493
@dynamicCallable
493-
struct SR12019_S {
494+
struct S_54456 {
494495
func dynamicallyCall<T: StringProtocol>(withArguments: [T]) { // expected-note {{where 'T' = 'Int'}}
495496
print("hi")
496497
}
497498
}
498499

499500
@dynamicCallable
500-
protocol SR12019 {
501+
protocol P_54456 {
501502
func dynamicallyCall<T: StringProtocol>(withArguments: [T]) // expected-note 2{{where 'T' = 'Int'}}
502503
}
503504

504-
class SR12019Class: SR12019 {
505+
class C_54456: P_54456 {
505506
func dynamicallyCall<T: StringProtocol>(withArguments: [T]) {} // expected-note {{where 'T' = 'Int'}}
506507
}
507508

508-
class SR12019SubClass: SR12019Class {}
509+
class SubC_54456: C_54456 {}
509510

510-
let sr12019s = SR12019_S()
511-
sr12019s(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
511+
do {
512+
let s = S_54456()
513+
s(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
512514

513-
// Protocol composition
514-
let sr12019: SR12019&AnyObject = SR12019Class()
515-
sr12019(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
515+
// Protocol composition
516+
let pc: P_54456 & AnyObject = C_54456()
517+
pc(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
516518

517-
// Protocol
518-
let sr12019c: SR12019 = SR12019Class()
519-
sr12019c(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
519+
// Protocol
520+
let p: P_54456 = C_54456()
521+
p(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
520522

521-
// Subclass
522-
let sr12019sub = SR12019SubClass()
523-
sr12019sub(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
523+
// Subclass
524+
let sub = SubC_54456()
525+
sub(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
526+
}
524527

525528
protocol P {}
526529
extension P {

0 commit comments

Comments
 (0)