Skip to content

Commit 29d6170

Browse files
committed
Revert "Make test independent of function processing order"
This reverts commit 7f6da3b. This is failing on bots.
1 parent 8aea34d commit 29d6170

File tree

1 file changed

+41
-59
lines changed

1 file changed

+41
-59
lines changed

test/SILPasses/array_mutable_assertonly.swift

Lines changed: 41 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
1-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST1
2-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST2
3-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST3
4-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST4
5-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST5
6-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST6
7-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST7
8-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST8
9-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST9
10-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST10
11-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST11
12-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST12
13-
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s --check-prefix=TEST13
1+
// RUN: %target-swift-frontend -O -emit-sil -Xllvm -debug-only=cowarray-opts -primary-file %s 2>&1 | FileCheck %s
2+
// REQUIRES: rdar://23681223
143
// asserts,swift_stdlib_no_asserts,optimized_stdlib
154

16-
// TEST1-LABEL: COW Array Opts in Func {{.*}}inoutarr{{.*}}
17-
// TEST1: Hoisting make_mutable
18-
// TEST1: COW Array Opts
19-
5+
// CHECK-LABEL: COW Array Opts in Func {{.*}}inoutarr{{.*}}
6+
// CHECK: Hoisting make_mutable
7+
// CHECK: COW Array Opts
208
func inoutarr(inout a: [Int]) {
219
for i in 0..<a.count {
2210
a[i] = 0
@@ -27,16 +15,15 @@ struct S {
2715
var a: [Int]
2816
}
2917

30-
// TEST2-LABEL: COW Array Opts in Func {{.*}}arrelt{{.*}}
31-
// TEST2: Hoisting make_mutable
32-
// TEST2: COW Array Opts
18+
// CHECK-LABEL: COW Array Opts in Func {{.*}}arrelt{{.*}}
19+
// CHECK: Hoisting make_mutable
20+
// CHECK: COW Array Opts
3321
func arrelt(inout s: S) {
3422
for i in 0..<s.a.count {
3523
s.a[i] = 0
3624
}
3725
}
3826

39-
4027
class ArrayInClass {
4128
final var A : [Int]
4229
final var B : [Int]
@@ -48,28 +35,26 @@ class ArrayInClass {
4835
C = [[]]
4936
}
5037

51-
// TEST3-LABEL: COW Array Opts in Func {{.*}}hoistInClass{{.*}}
52-
// TEST3: Hoisting make_mutable
53-
// TEST3: COW Array Opts
38+
// CHECK-LABEL: COW Array Opts in Func {{.*}}hoistInClass{{.*}}
39+
// CHECK: Hoisting make_mutable
5440
func hoistInClass() {
5541
for i in 0..<A.count {
5642
A[i] = 0
5743
}
5844
}
5945

60-
// TEST4-LABEL: COW Array Opts in Func {{.*}}hoistInClass2Arr{{.*}}
61-
// TEST4: Hoisting make_mutable
62-
// TEST4: COW Array Opts
46+
// CHECK-LABEL: COW Array Opts in Func {{.*}}hoistInClass2Arr{{.*}}
47+
// CHECK: Hoisting make_mutable
6348
func hoistInClass2Arr() {
6449
for i in 0..<A.count {
6550
A[i] = 0
6651
B[i] = 2
6752
}
6853
}
6954

70-
// TEST5-LABEL: COW Array Opts in Func {{.*}}dontHoistInClassAppend{{.*}}
71-
// TEST5-NOT: Hoisting make_mutable
72-
// TEST5: COW Array Opts in Func
55+
// CHECK-LABEL: COW Array Opts in Func {{.*}}dontHoistInClassAppend{{.*}}
56+
// CHECK-NOT: Hoisting make_mutable
57+
// CHECK: COW Array Opts in Func
7358
func dontHoistInClassAppend() {
7459
for i in 0..<A.count {
7560
A[i] = 0
@@ -84,14 +69,13 @@ struct Array2d {
8469
var rows : Int
8570
}
8671

87-
// TEST6-LABEL: COW Array Opts in Func {{.*}}test2DArrayLoop{{.*}}
88-
// TEST6: Array Opts in Loop Loop at depth 2
89-
// TEST6-NOT: COW Array Opts in
90-
// TEST6: Hoisting make_mutable
91-
// TEST6: Array Opts in Loop Loop at depth 1
92-
// TEST6-NOT: COW Array Opts in
93-
// TEST6: Hoisting make_mutable
94-
// TEST6: COW Array Opts in
72+
// CHECK-LABEL: COW Array Opts in Func {{.*}}test2DArrayLoop{{.*}}
73+
// CHECK: Array Opts in Loop Loop at depth 2
74+
// CHECK-NOT: COW Array Opts in
75+
// CHECK: Hoisting make_mutable
76+
// CHECK: Array Opts in Loop Loop at depth 1
77+
// CHECK-NOT: COW Array Opts in
78+
// CHECK: Hoisting make_mutable
9579

9680
func test2DArrayLoop(inout A : Array2d) {
9781
for r in 0 ..< A.rows {
@@ -103,18 +87,18 @@ func test2DArrayLoop(inout A : Array2d) {
10387

10488
class AClass {}
10589

106-
// TEST7-LABEL: COW Array Opts in Func {{.*}}hoistArrayOfClasses{{.*}}
107-
// TEST7: Hoisting make_mutable
108-
// TEST7: COW Array Opts
90+
// CHECK-LABEL: COW Array Opts in Func {{.*}}hoistArrayOfClasses{{.*}}
91+
// CHECK: Hoisting make_mutable
92+
10993
func hoistArrayOfClasses(inout A : [AClass], x: AClass) {
11094
for i in 0 ..< A.count {
11195
A[i] = x
11296
}
11397
}
11498

115-
// TEST8-LABEL: COW Array Opts in Func {{.*}}hoistMutableOfAppend{{.*}}
116-
// TEST8: Hoisting make_mutable
117-
// TEST8: COW Array Opts
99+
// CHECK-LABEL: COW Array Opts in Func {{.*}}hoistMutableOfAppend{{.*}}
100+
// CHECK: Hoisting make_mutable
101+
// CHECK: COW Array Opts
118102

119103
func hoistMutableOfAppend(inout A : [Int]) {
120104
for i in 0 ..< 10 {
@@ -130,9 +114,9 @@ class ArrayHolder {
130114
final var A : [[Int]]
131115
init() { A = [] }
132116

133-
// TEST9-LABEL: COW Array Opts in Func {{.*}}hoist2DArrayInClass
134-
// TEST9: Hoisting make_mutable
135-
// TEST9: COW Array Opts
117+
// CHECK-LABEL: COW Array Opts in Func {{.*}}hoist2DArrayInClass
118+
// CHECK: Hoisting make_mutable
119+
// CHECK: COW Array Opts
136120

137121
func hoist2DArrayInClass() {
138122
for i in 0 ..< 10 {
@@ -142,9 +126,8 @@ class ArrayHolder {
142126
}
143127
}
144128

145-
// TEST10-LABEL: COW Array Opts in Func {{.*}}dontHoist2DArray
146-
// TEST10-NOT: Hoisting make_mutable
147-
// TEST10: COW Array Opts
129+
// CHECK-LABEL: COW Array Opts in Func {{.*}}dontHoist2DArray
130+
// CHECK-NOT: Hoisting make_mutable
148131

149132
func dontHoist2DArray(){
150133
var escape : [Int] = []
@@ -157,9 +140,8 @@ class ArrayHolder {
157140
use(escape)
158141
}
159142

160-
// TEST11-LABEL: COW Array Opts in Func {{.*}}dontHoist2DArray2
161-
// TEST11-NOT: Hoisting make_mutable
162-
// TEST11: COW Array Opts
143+
// CHECK-LABEL: COW Array Opts in Func {{.*}}dontHoist2DArray2
144+
// CHECK-NOT: Hoisting make_mutable
163145

164146
func dontHoist2DArray2(){
165147
let b = [0]
@@ -171,9 +153,9 @@ class ArrayHolder {
171153
}
172154
}
173155

174-
// TEST12-LABEL: COW Array Opts in Func {{.*}}dontHoist2DArray3
175-
// TEST12-NOT: Hoisting make_mutable
176-
// TEST12: COW Array Opts
156+
// CHECK-LABEL: COW Array Opts in Func {{.*}}dontHoist2DArray3
157+
// CHECK-NOT: Hoisting make_mutable
158+
// CHECK: COW Array Opts
177159

178160
func dontHoist2DArray3() {
179161
for i in 0 ..< A.count {
@@ -185,9 +167,9 @@ class ArrayHolder {
185167
}
186168
}
187169

188-
// TEST13-LABEL: COW Array Opts in Func {{.*}}hoist2DArray
189-
// TEST13: Hoisting make_mutable
190-
// TEST13: COW Array Opts
170+
// CHECK-LABEL: COW Array Opts in Func {{.*}}hoist2DArray
171+
// CHECK: Hoisting make_mutable
172+
// CHECK: COW Array Opts
191173

192174
func hoist2DArray(inout a: [[Int]]) {
193175
for i in 0 ..< a.count {

0 commit comments

Comments
 (0)