Skip to content

Commit 0a46b4b

Browse files
authored
Merge pull request #17663 from rudkx/adjust-test-complexity
Adjust several type checker perf tests to be more complex.
2 parents 7edca76 + 8d980c9 commit 0a46b4b

File tree

7 files changed

+15
-7
lines changed

7 files changed

+15
-7
lines changed

validation-test/Sema/type_checker_perf/slow/rdar19612086.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ struct rdar19612086 {
1313
var description : String {
1414
return "\(i)" + Stringly(format: "%.2f", x) +
1515
"\(i+1)" + Stringly(format: "%.2f", x) +
16-
"\(i+2)" + Stringly(format: "%.2f", x)
16+
"\(i+2)" + Stringly(format: "%.2f", x) +
17+
"\(i+3)" + Stringly(format: "%.2f", x) +
18+
"\(i+4)" + Stringly(format: "%.2f", x) +
19+
"\(i+5)" + Stringly(format: "%.2f", x)
1720
// expected-error@-1 {{reasonable time}}
1821
}
1922
}

validation-test/Sema/type_checker_perf/slow/rdar20859567.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ struct Stringly {
99

1010
[Int](0..<1).map {
1111
// expected-error@-1 {{reasonable time}}
12-
print(Stringly(format: "%d: ", $0 * 2 * 42) + ["a", "b", "c", "d", "e", "f", "g"][$0 * 2] + "," + "," + ",")
12+
print(Stringly(format: "%d: ",
13+
$0 * 2 * 42 +
14+
$0 * 2 * 42 +
15+
$0 * 2 * 42
16+
) + ["a", "b", "c", "d", "e", "f", "g"][$0 * 2] + "," + "," + ",")
1317
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
22
// REQUIRES: tools-release,no_asserts
33

4-
_ = [0,1,2,3].lazy.map { String($0)+"hi" }.sorted(by: { $0 > $1 })
4+
_ = [0,1,2,3].lazy.map { String($0)+"hi" }.sorted(by: { $0 > $1 && $1 < $0 && ($1 + $0) < 1000 })
55
// expected-error@-1 {{reasonable time}}

validation-test/Sema/type_checker_perf/slow/rdar23429943.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
let _ = [0].reduce([Int]()) {
55
// expected-error@-1 {{reasonable time}}
6-
return $0.count == 0 && $1 == 0 ? [] : $0 + [$1]
6+
return $0.count == 0 && ($1 == 0 || $1 == 2 || $1 == 3) ? [] : $0 + [$1]
77
}

validation-test/Sema/type_checker_perf/slow/rdar23861629.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ struct S { var s: String? }
66
func rdar23861629(_ a: [S]) {
77
_ = a.reduce("") {
88
// expected-error@-1 {{reasonable time}}
9-
($0 == "") ? ($1.s ?? "") : $0 + "," + ($1.s ?? "")
9+
($0 == "") ? ($1.s ?? "") : ($0 + "," + ($1.s ?? "")) + ($1.s ?? "test") + ($1.s ?? "okay")
1010
}
1111
}

validation-test/Sema/type_checker_perf/slow/rdar31742586.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
// REQUIRES: tools-release,no_asserts
33

44
func rdar31742586() -> Double {
5-
return -(1 + 2) + -(3 + 4) + 5
5+
return -(1 + 2) + -(3 + 4) + 5 - (-(1 + 2) + -(3 + 4) + 5)
66
// expected-error@-1 {{reasonable time}}
77
}

validation-test/Sema/type_checker_perf/slow/rdar32998180.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// REQUIRES: tools-release,no_asserts
33

44
func rdar32998180(value: UInt16) -> UInt16 {
5-
var result = (((value >> 1) ^ (value >> 1) ^ (value >> 1) ^ (value >> 1)) & 1) << 1
5+
var result = ((((value >> 1) ^ (value >> 1) ^ (value >> 1) ^ (value >> 1)) & 1) << 1)
6+
| (((((value >> 1) ^ (value >> 1) ^ (value >> 1) ^ (value >> 1)) & 1) << 1) << 1)
67
// expected-error@-1 {{reasonable time}}
78
return result
89
}

0 commit comments

Comments
 (0)