Skip to content

Adjust several type checker perf tests to be more complex. #17663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ struct rdar19612086 {
var description : String {
return "\(i)" + Stringly(format: "%.2f", x) +
"\(i+1)" + Stringly(format: "%.2f", x) +
"\(i+2)" + Stringly(format: "%.2f", x)
"\(i+2)" + Stringly(format: "%.2f", x) +
"\(i+3)" + Stringly(format: "%.2f", x) +
"\(i+4)" + Stringly(format: "%.2f", x) +
"\(i+5)" + Stringly(format: "%.2f", x)
// expected-error@-1 {{reasonable time}}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ struct Stringly {

[Int](0..<1).map {
// expected-error@-1 {{reasonable time}}
print(Stringly(format: "%d: ", $0 * 2 * 42) + ["a", "b", "c", "d", "e", "f", "g"][$0 * 2] + "," + "," + ",")
print(Stringly(format: "%d: ",
$0 * 2 * 42 +
$0 * 2 * 42 +
$0 * 2 * 42
) + ["a", "b", "c", "d", "e", "f", "g"][$0 * 2] + "," + "," + ",")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
// REQUIRES: tools-release,no_asserts

_ = [0,1,2,3].lazy.map { String($0)+"hi" }.sorted(by: { $0 > $1 })
_ = [0,1,2,3].lazy.map { String($0)+"hi" }.sorted(by: { $0 > $1 && $1 < $0 && ($1 + $0) < 1000 })
// expected-error@-1 {{reasonable time}}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

let _ = [0].reduce([Int]()) {
// expected-error@-1 {{reasonable time}}
return $0.count == 0 && $1 == 0 ? [] : $0 + [$1]
return $0.count == 0 && ($1 == 0 || $1 == 2 || $1 == 3) ? [] : $0 + [$1]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ struct S { var s: String? }
func rdar23861629(_ a: [S]) {
_ = a.reduce("") {
// expected-error@-1 {{reasonable time}}
($0 == "") ? ($1.s ?? "") : $0 + "," + ($1.s ?? "")
($0 == "") ? ($1.s ?? "") : ($0 + "," + ($1.s ?? "")) + ($1.s ?? "test") + ($1.s ?? "okay")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// REQUIRES: tools-release,no_asserts

func rdar31742586() -> Double {
return -(1 + 2) + -(3 + 4) + 5
return -(1 + 2) + -(3 + 4) + 5 - (-(1 + 2) + -(3 + 4) + 5)
// expected-error@-1 {{reasonable time}}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// REQUIRES: tools-release,no_asserts

func rdar32998180(value: UInt16) -> UInt16 {
var result = (((value >> 1) ^ (value >> 1) ^ (value >> 1) ^ (value >> 1)) & 1) << 1
var result = ((((value >> 1) ^ (value >> 1) ^ (value >> 1) ^ (value >> 1)) & 1) << 1)
| (((((value >> 1) ^ (value >> 1) ^ (value >> 1) ^ (value >> 1)) & 1) << 1) << 1)
// expected-error@-1 {{reasonable time}}
return result
}