|
1 |
| -// RUN: %clang_cc1 -std=c++17 -fexperimental-new-constant-interpreter -verify %s |
2 |
| -// RUN: %clang_cc1 -std=c++17 -verify=ref %s |
| 1 | +// RUN: %clang_cc1 -std=c++17 -fexperimental-new-constant-interpreter -verify=expected,both %s |
| 2 | +// RUN: %clang_cc1 -std=c++17 -verify=ref,both %s |
3 | 3 |
|
4 | 4 | constexpr bool isEven(int a) {
|
5 | 5 | bool v = false;
|
@@ -75,20 +75,14 @@ constexpr int test(int val) {
|
75 | 75 | }
|
76 | 76 | static_assert(test(1) == 100, "");
|
77 | 77 |
|
78 |
| -constexpr int bad(int val) { return val / 0; } // expected-warning {{division by zero}} \ |
79 |
| - // ref-warning {{division by zero}} |
80 |
| -constexpr int another_test(int val) { // expected-note {{declared here}} \ |
81 |
| - // ref-note {{declared here}} |
| 78 | +constexpr int bad(int val) { return val / 0; } // both-warning {{division by zero}} |
| 79 | +constexpr int another_test(int val) { // both-note {{declared here}} |
82 | 80 | switch (val) {
|
83 |
| - case bad(val): return 100; // expected-error {{case value is not a constant expression}} \ |
84 |
| - // expected-note {{cannot be used in a constant expression}} \ |
85 |
| - // ref-error {{case value is not a constant expression}} \ |
86 |
| - // ref-note {{cannot be used in a constant expression}} |
| 81 | + case bad(val): return 100; // both-error {{case value is not a constant expression}} \ |
| 82 | + // both-note {{cannot be used in a constant expression}} |
87 | 83 | default: return -1;
|
88 | 84 | }
|
89 | 85 | return 0;
|
90 | 86 | }
|
91 |
| -static_assert(another_test(1) == 100, ""); // expected-error {{static assertion failed}} \ |
92 |
| - // expected-note {{evaluates to}} \ |
93 |
| - // ref-error {{static assertion failed}} \ |
94 |
| - // ref-note {{evaluates to}} |
| 87 | +static_assert(another_test(1) == 100, ""); // both-error {{static assertion failed}} \ |
| 88 | + // both-note {{evaluates to}} |
0 commit comments