Skip to content

Commit 15db242

Browse files
authored
Merge pull request #77112 from slavapestov/solver-perf-tests
Add a couple of solver performance tests
2 parents 2720316 + d502e55 commit 15db242

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=10
2+
3+
struct S {
4+
var t: Double
5+
6+
init(_ t: Double) {
7+
self.t = t
8+
}
9+
}
10+
11+
func f(x: Array<S>, y: Range<Int>) -> [S] {
12+
return x.flatMap { z in
13+
return ((y.lowerBound / 1)...(y.upperBound + 1) / 1).flatMap { w in
14+
return [S(1 * Double(w) + 1.0 + z.t),
15+
S(1 * Double(w) + 1.0 - z.t)]
16+
}
17+
}
18+
}
19+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %scale-test --invert-result --begin 2 --end 5 --step 1 --select NumLeafScopes %s
2+
3+
func g<T: Equatable>(_: T, _: T) {}
4+
5+
let base: UInt64 = 0
6+
7+
func f() {
8+
g(base, (0 * 0)
9+
%for i in range(1, N):
10+
+ 0
11+
%end
12+
)
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %scale-test --invert-result --begin 1 --end 5 --step 1 --select NumLeafScopes %s
2+
3+
func f(c: Float, a: SIMD2<Float>) -> SIMD2<Float> {
4+
return (c * a)
5+
%for i in range(1, N):
6+
+ (c * a)
7+
%end
8+
}

0 commit comments

Comments
 (0)