Skip to content

Commit 7fb62f6

Browse files
committed
Gardening: Migrate test suite to GH issues: SILOptimizer (1/2)
1 parent 08588b9 commit 7fb62f6

9 files changed

+84
-79
lines changed

test/SILOptimizer/OSLogFullOptTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// dead_array_elim.swift. The problem can be overcome by handling
1616
// non-trivial stores in OSSA, as described here:
1717
// [OSSA] Improve DeadObjectElimination to handle array copies
18-
// https://bugs.swift.org/browse/SR-13782
18+
// https://github.com/apple/swift/issues/56179
1919
// Once that bug is fixed, remove the requirement: swift_stdlib_no_asserts.
2020

2121
import OSLogTestHelper

test/SILOptimizer/copyforward_ossa.sil

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,10 @@ bb0(%0 : $*T, %1 : $*T):
482482
return %r1 : $()
483483
}
484484

485-
// <rdar://problem/43888666> [SR-8526]: Memory leak after switch in release configuration
485+
// rdar://problem/43888666
486+
// https://github.com/apple/swift/issues/51046
487+
// Memory leak after switch in release configuration
488+
//
486489
// CHECK-LABEL: sil [ossa] @testGlobalHoistToStoredValue : $@convention(thin) (@owned AClass, @inout AClass) -> () {
487490
// CHECK: bb0(%0 : @owned $AClass, %1 : $*AClass):
488491
// CHECK-NEXT: [[LOCAL:%.*]] = alloc_stack $AClass

test/SILOptimizer/dead_array_elim.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// second array is initialized by copying the first. This problem can be
2323
// overcome by handling non-trivial stores in OSSA, as described here:
2424
// [OSSA] Improve DeadObjectElimination to handle array copies
25-
// https://bugs.swift.org/browse/SR-13782
25+
// https://github.com/apple/swift/issues/56179
2626
// Once that bug is fixed, remove the requirement: swift_stdlib_no_asserts.
2727

2828
// CHECK-LABEL: sil hidden @$s15dead_array_elim24testDeadArrayEliminationyyF

test/SILOptimizer/dead_code_elimination_ossa.sil

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ bb0(%0 : @owned $(String, (Int, Int, String))):
296296

297297
// Test fix_lifetime of a struct and tuple. It cannot be removed
298298
// without proving reference uniqueness first.
299-
// rdar://36038096 ([SR-6608] DeadCodeElimination removes fix_lifetime instructions.)
299+
// rdar://36038096
300+
// https://github.com/apple/swift/issues/49158
300301
//
301302
// CHECK-LABEL: @testFixLifetimeTuple : $@convention(thin) (@owned S, @owned AnyObject) -> () {
302303
// CHECK: bb0(%0 : $S, %1 : $AnyObject):

test/SILOptimizer/definite_init_diagnostics.swift

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ func test22436880() {
10981098
bug22436880(&x) // expected-error {{immutable value 'x' must not be passed inout}}
10991099
}
11001100

1101-
// sr-184
1101+
// https://github.com/apple/swift/issues/42806
11021102
let x: String? // expected-note 2 {{constant defined here}}
11031103
print(x?.count as Any) // expected-error {{constant 'x' used before being initialized}}
11041104
print(x!) // expected-error {{constant 'x' used before being initialized}}
@@ -1157,8 +1157,9 @@ class r23013334Derived : rdar16119509_Base {
11571157

11581158
}
11591159

1160-
// sr-1469
1161-
struct SR1469_Struct1 {
1160+
// https://github.com/apple/swift/issues/44078
1161+
1162+
struct S1_44078 {
11621163
let a: Int
11631164
let b: Int // expected-note {{'self.b' not initialized}}
11641165

@@ -1172,7 +1173,7 @@ struct SR1469_Struct1 {
11721173
}
11731174
}
11741175

1175-
struct SR1469_Struct2 {
1176+
struct S2_44078 {
11761177
let a: Int
11771178
let b: Int // expected-note {{'self.b' not initialized}}
11781179

@@ -1182,7 +1183,7 @@ struct SR1469_Struct2 {
11821183
}
11831184
}
11841185

1185-
struct SR1469_Struct3 {
1186+
struct S3_44078 {
11861187
let a: Int
11871188
let b: Int // expected-note {{'self.b' not initialized}}
11881189

@@ -1195,7 +1196,7 @@ struct SR1469_Struct3 {
11951196
} // expected-error {{return from initializer without initializing all stored properties}}
11961197
}
11971198

1198-
enum SR1469_Enum1 {
1199+
enum E1_44078 {
11991200
case A, B
12001201

12011202
init?(x: Int) {
@@ -1207,14 +1208,14 @@ enum SR1469_Enum1 {
12071208
} // expected-error {{'self.init' isn't called on all paths before returning from initializer}}
12081209
}
12091210

1210-
enum SR1469_Enum2 {
1211+
enum E2_44078 {
12111212
case A, B
12121213

12131214
init?() {
12141215
return
12151216
} // expected-error {{'self.init' isn't called on all paths before returning from initializer}}
12161217
}
1217-
enum SR1469_Enum3 {
1218+
enum E3_44078 {
12181219
case A, B
12191220

12201221
init?(x: Int) {
@@ -1553,7 +1554,8 @@ func testOptionalUnwrapNoError() -> Int? {
15531554
return x!
15541555
}
15551556

1556-
// <https://bugs.swift.org/browse/SR-9451>
1557+
// https://github.com/apple/swift/issues/51914
1558+
15571559
class StrongCycle {
15581560
var c: StrongCycle
15591561
var d: Int

test/SILOptimizer/di_property_wrappers.swift

Lines changed: 50 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct IntStruct {
6464
}
6565

6666
// Check that we don't crash if the function has unrelated generic parameters.
67-
// SR-11484
67+
// https://github.com/apple/swift/issues/53884
6868
mutating func setit<V>(_ v: V) {
6969
wrapped = 5
7070
}
@@ -435,54 +435,49 @@ func testComposed() {
435435
// CHECK-NEXT: .. init Wrapper2<Int>(wrappedValue: 17)
436436
}
437437

438-
// SR-11477
439-
440-
@propertyWrapper
441-
struct SR_11477_W {
442-
let name: String
438+
// https://github.com/apple/swift/issues/53877
439+
func testWrapperInitWithDefaultArg() {
440+
@propertyWrapper
441+
struct W1 {
442+
let name: String
443443

444-
init(name: String = "DefaultParamInit") {
445-
self.name = name
446-
}
444+
init(name: String = "DefaultParamInit") {
445+
self.name = name
446+
}
447447

448-
var wrappedValue: Int {
449-
get { return 0 }
448+
var wrappedValue: Int { 0 }
450449
}
451-
}
452450

453-
@propertyWrapper
454-
struct SR_11477_W1 {
455-
let name: String
451+
@propertyWrapper
452+
struct W2 {
453+
let name: String
456454

457-
init() {
458-
self.name = "Init"
459-
}
455+
init() {
456+
self.name = "Init"
457+
}
460458

461-
init(name: String = "DefaultParamInit") {
462-
self.name = name
463-
}
459+
init(name: String = "DefaultParamInit") {
460+
self.name = name
461+
}
464462

465-
var wrappedValue: Int {
466-
get { return 0 }
467-
}
468-
}
463+
var wrappedValue: Int { 0 }
464+
}
469465

470-
struct SR_11477_C {
471-
@SR_11477_W var property: Int
472-
@SR_11477_W1 var property1: Int
466+
struct S {
467+
@W1 var property1: Int
468+
@W2 var property2: Int
473469

474-
init() {}
475-
func foo() { print(_property.name) }
476-
func foo1() { print(_property1.name) }
477-
}
470+
init() {}
471+
func foo1() { print(_property1.name) }
472+
func foo2() { print(_property2.name) }
473+
}
478474

479-
func testWrapperInitWithDefaultArg() {
480475
// CHECK: ## InitWithDefaultArg
481476
print("\n## InitWithDefaultArg")
482-
let use = SR_11477_C()
477+
let use = S()
483478

484-
use.foo()
485479
use.foo1()
480+
use.foo2()
486481
// CHECK-NEXT: DefaultParamInit
487482
// CHECK-NEXT: Init
488483
}
@@ -514,37 +509,37 @@ public final class Synchronized<Value> {
514509
}
515510
}
516511

512+
// https://github.com/apple/swift/issues/54775
513+
func test54775() {
514+
struct S {
515+
@Wrapper var wrapped: Int = 10
516+
var str: String
517517

518-
struct SR_12341 {
519-
@Wrapper var wrapped: Int = 10
520-
var str: String
521-
522-
init() {
523-
wrapped = 42
524-
str = ""
525-
wrapped = 27
526-
}
518+
init() {
519+
wrapped = 42
520+
str = ""
521+
wrapped = 27
522+
}
527523

528-
init(condition: Bool) {
529-
wrapped = 42
530-
wrapped = 27
531-
str = ""
524+
init(condition: Bool) {
525+
wrapped = 42
526+
wrapped = 27
527+
str = ""
528+
}
532529
}
533-
}
534530

535-
func testSR_12341() {
536-
// CHECK: ## SR_12341
537-
print("\n## SR_12341")
531+
// CHECK: ## issue-54775
532+
print("n## issue-54775")
538533

539534
// CHECK-NEXT: .. init 10
540535
// CHECK-NEXT: .. init 42
541536
// CHECK-NEXT: .. set 27
542-
_ = SR_12341()
537+
_ = S()
543538

544539
// CHECK-NEXT: .. init 10
545540
// CHECK-NEXT: .. init 42
546541
// CHECK-NEXT: .. init 27
547-
_ = SR_12341(condition: true)
542+
_ = S(condition: true)
548543
}
549544

550545
@propertyWrapper
@@ -628,6 +623,6 @@ testOptIntStruct()
628623
testDefaultNilOptIntStruct()
629624
testComposed()
630625
testWrapperInitWithDefaultArg()
631-
testSR_12341()
626+
test54775()
632627
testNonMutatingSetterStruct()
633628
testStructWithClassWrapper()

test/SILOptimizer/di_property_wrappers_errors.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ struct IntStructWithClassWrapper {
4141
}
4242
}
4343

44-
// SR_11477
44+
// https://github.com/apple/swift/issues/53877
4545

4646
@propertyWrapper
47-
struct SR_11477_W {
47+
struct W_53877 {
4848
let name: String
4949

5050
init<T: ExpressibleByIntegerLiteral>(_ value: T = 0) {
@@ -56,8 +56,8 @@ struct SR_11477_W {
5656
}
5757
}
5858

59-
struct SR_11477_S {
60-
@SR_11477_W var foo: Int
59+
struct S_53877 {
60+
@W_53877 var foo: Int
6161
init() {} // expected-error {{return from initializer without initializing all stored properties}} expected-note {{'self.foo' not initialized}}
6262
}
6363

test/SILOptimizer/diagnose_unreachable.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,15 @@ while true {
344344
// no warning!
345345

346346

347-
// SR-1010 - rdar://25278336 - Spurious "will never be executed" warnings when building standard library
348-
struct SR1010<T> {
347+
// rdar://25278336
348+
// https://github.com/apple/swift/issues/43622
349+
// Spurious 'will never be executed' warnings when building standard library
350+
351+
struct S_43622<T> {
349352
var a : T
350353
}
351354

352-
extension SR1010 {
355+
extension S_43622 {
353356
@available(*, unavailable, message: "use the 'enumerated()' method on the sequence")
354357
init(_ base: Int) {
355358
fatalError("unavailable function can't be called")
@@ -373,7 +376,7 @@ class FailingClass {
373376
}
374377
}
375378

376-
// <https://bugs.swift.org/browse/SR-2729>
379+
// https://github.com/apple/swift/issues/45333
377380
// We should not report unreachable code inside protocol witness thunks
378381

379382
protocol Fooable {
@@ -437,7 +440,7 @@ func sillyGenericExample() -> Never {
437440
}
438441
}
439442

440-
// https://bugs.swift.org/browse/SR-7472
443+
// https://github.com/apple/swift/issues/50015
441444

442445
protocol P {
443446
static var theThing: Self { get }

test/SILOptimizer/diagnostic_constant_propagation.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
// tests here that must fail don't currently. Such tests have comments
77
// describing the desirable behavior. They are false negatives now but have
88
// to be addressed in the future.
9-
// References: <rdar://problem/29937936>,
10-
// <https://bugs.swift.org/browse/SR-5964>
9+
// References:
10+
// rdar://problem/29937936
11+
// https://github.com/apple/swift/issues/48523
1112

1213
import StdlibUnittest
1314

0 commit comments

Comments
 (0)