Skip to content

Commit 4fc5830

Browse files
committed
[Test] Complicate a "fast" type checker test to make it slow.
This test only happened to be under the constraint system thresholds, but the performance was not fast. Add a few operands to the + chain, and disable shrink to push the solver past the performance thresholds.
1 parent 8a3cae5 commit 4fc5830

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
1+
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1 -solver-disable-shrink
22
// REQUIRES: tools-release,no_asan
33
// UNSUPPORTED: swift_test_mode_optimize_none && OS=linux-gnu
44

55
func rdar26564101(a: [Double], m: Double) -> Double {
6-
return Double(Array(0...a.count - 1).reduce(0) { $0 + $1 - m })
7-
// expected-error@-1 {{cannot convert value of type}}
6+
// expected-error@+1 {{unable to type-check this expression in reasonable time}}
7+
return Double(Array(0...a.count - 1).reduce(0) {
8+
$0 + $1 - m + $0 + $1 + $0
9+
})
810
}

0 commit comments

Comments
 (0)