File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change 1
- // Ensure that -switch-checking-invocation-threshold= frontend option works.
1
+ // Ensure that -switch-checking-invocation-threshold= frontend option works,
2
+ // stopping the check, producing the correct diagnostic, and not producing the
3
+ // diagnostic for a completed check.
2
4
//
3
- // RUN: not %target-swift-frontend -typecheck %s -switch-checking-invocation-threshold=1 2>&1 | %FileCheck %s --check-prefix LIMIT
4
- // RUN: not %target-swift-frontend -typecheck %s 2>&1 | %FileCheck %s --check-prefix NO_LIMIT
5
- // LIMIT: error: the compiler is unable to check that this switch is exhaustive in reasonable time
6
- // LIMIT-NOT: error: switch must be exhaustive
7
- // NO_LIMIT: error: switch must be exhaustive
8
- // NO_LIMIT-NOT: error: the compiler is unable to check that this switch is exhaustive in reasonable time
5
+ // RUN: %empty-directory(%t)
6
+ //
7
+ // RUN: not %target-swift-frontend -typecheck %s -switch-checking-invocation-threshold=1 2>%t/unproven.txt
8
+ // RUN: %FileCheck %s --check-prefix UNABLE-TO-CHECK <%t/unproven.txt
9
+ // RUN: not %FileCheck %s --check-prefix MUST-BE-EXHAUSTIVE <%t/unproven.txt
10
+ //
11
+ // RUN: not %target-swift-frontend -typecheck %s 2>%t/disproved.txt
12
+ // RUN: %FileCheck %s --check-prefix MUST-BE-EXHAUSTIVE <%t/disproved.txt
13
+ // RUN: not %FileCheck %s --check-prefix UNABLE-TO-CHECK <%t/disproved.txt
14
+ //
15
+ // UNABLE-TO-CHECK: error: the compiler is unable to check that this switch is exhaustive in reasonable time
16
+ // MUST-BE-EXHAUSTIVE: error: switch must be exhaustive
9
17
10
- import Foundation
11
18
12
19
enum A {
13
20
case a1, a2, a3, a4, a5
You can’t perform that action at this time.
0 commit comments