Skip to content

Commit ce9e7cc

Browse files
committed
Sema: A couple of type checker tests were incorrectly in the 'slow' directory
They're actually fast. Also, change -solver-expression-time-threshold=1 into a scope limit to make it deterministic.
1 parent d652100 commit ce9e7cc

File tree

6 files changed

+38
-28
lines changed

6 files changed

+38
-28
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %target-typecheck-verify-swift -solver-scope-threshold=300
2+
3+
func slow(someOptionalString: String?) {
4+
print("\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")\(someOptionalString ?? "")")
5+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %scale-test --begin 1 --end 6 --step 1 --select NumLeafScopes %s
2+
// REQUIRES: asserts,no_asan
3+
4+
extension String {
5+
func replacingOccurrences(of: String, with: String) -> String {
6+
return ""
7+
}
8+
}
9+
10+
func slow(something: String?) {
11+
var str = ""
12+
13+
[
14+
%for i in range(0, N):
15+
("${i}", something ?? ""),
16+
%end
17+
].forEach {
18+
str = str.replacingOccurrences(of: $0, with: $1)
19+
}
20+
}

validation-test/Sema/type_checker_perf/slow/rdar23327871.swift.gyb renamed to validation-test/Sema/type_checker_perf/fast/rdar23327871.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %scale-test --begin 8 --end 16 --step 1 --select NumLeafScopes %s -Xfrontend=-solver-expression-time-threshold=1
1+
// RUN: %scale-test --begin 8 --end 16 --step 1 --select NumLeafScopes %s
22
// REQUIRES: asserts,no_asan
33

44
let i = 1
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: not %scale-test --begin 1 --end 5 --step 1 --select incrementScopeCounter %s
2+
// REQUIRES: OS=macosx
3+
// REQUIRES: asserts
4+
5+
func f() {
6+
% for i in range(N):
7+
let collection${i} = [String]()
8+
% end
9+
10+
_ = ${' + '.join("collection%s" % i for i in range(N))}
11+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
1+
// RUN: %target-typecheck-verify-swift -solver-scope-threshold=200
22
// REQUIRES: tools-release,no_asan
33

44
let _ = 1 | UInt32(0) << 0 | UInt32(1) << 1 | UInt32(2) << 2 | UInt32(3) << 3 | UInt32(4) << 4

validation-test/Sema/type_checker_perf/slow/rdar25866240.gyb

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)