[CSOptimizer/Tests] NFC: Add a perf test-case fixed by improved literal array handling

This commit is contained in:
Pavel Yaskevich
2024-12-25 15:17:40 -08:00
parent 8a304f88c6
commit cfd34e54c4

View File

@@ -0,0 +1,23 @@
// RUN: %scale-test --begin 1 --end 15 --step 1 --select NumLeafScopes %s --expected-exit-code 0
// REQUIRES: asserts,no_asan
enum E {
case a
case b
case c(Int32)
}
struct Tester {
mutating func test(arr: [E], cond: Bool = false) {}
mutating func test(arr: E..., cond: Bool = false) {}
}
func test() {
var tester = Tester()
tester.test(arr: [
.c(1), .a,
%for i in range(N):
.c(1 << 4 | 8), .c(0),
%end
.c(1), .b])
}