Skip to content

Commit a970090

Browse files
committed
[clang][Interp][NFC] Convert test case to verify=expected,all style
1 parent 356fdc3 commit a970090

File tree

1 file changed

+13
-37
lines changed
  • clang/test/AST/Interp

1 file changed

+13
-37
lines changed

clang/test/AST/Interp/c.c

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify -std=c11 %s
2-
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -pedantic -verify=pedantic-expected -std=c11 %s
3-
// RUN: %clang_cc1 -verify=ref -std=c11 %s
4-
// RUN: %clang_cc1 -pedantic -verify=pedantic-ref -std=c11 %s
1+
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,all -std=c11 %s
2+
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -pedantic -verify=pedantic-expected,all -std=c11 %s
3+
// RUN: %clang_cc1 -verify=ref,all -std=c11 %s
4+
// RUN: %clang_cc1 -pedantic -verify=pedantic-ref,all -std=c11 %s
55

66
typedef __INTPTR_TYPE__ intptr_t;
77
typedef __PTRDIFF_TYPE__ ptrdiff_t;
@@ -22,10 +22,7 @@ _Static_assert(!!1.0, ""); // pedantic-ref-warning {{not an integer constant exp
2222
_Static_assert(!!1, "");
2323

2424
int a = (1 == 1 ? 5 : 3);
25-
_Static_assert(a == 5, ""); // ref-error {{not an integral constant expression}} \
26-
// pedantic-ref-error {{not an integral constant expression}} \
27-
// expected-error {{not an integral constant expression}} \
28-
// pedantic-expected-error {{not an integral constant expression}}
25+
_Static_assert(a == 5, ""); // all-error {{not an integral constant expression}}
2926

3027

3128
const int b = 3;
@@ -67,52 +64,34 @@ _Static_assert((&a - 100) != 0, ""); // pedantic-ref-warning {{is a GNU extensio
6764
/// extern variable of a composite type.
6865
/// FIXME: The 'cast from void*' note is missing in the new interpreter.
6966
extern struct Test50S Test50;
70-
_Static_assert(&Test50 != (void*)0, ""); // ref-warning {{always true}} \
71-
// pedantic-ref-warning {{always true}} \
67+
_Static_assert(&Test50 != (void*)0, ""); // all-warning {{always true}} \
7268
// pedantic-ref-warning {{is a GNU extension}} \
7369
// pedantic-ref-note {{cast from 'void *' is not allowed}} \
74-
// expected-warning {{always true}} \
75-
// pedantic-expected-warning {{always true}} \
7670
// pedantic-expected-warning {{is a GNU extension}}
7771

7872
struct y {int x,y;};
79-
int a2[(intptr_t)&((struct y*)0)->y]; // expected-warning {{folded to constant array}} \
80-
// pedantic-expected-warning {{folded to constant array}} \
81-
// ref-warning {{folded to constant array}} \
82-
// pedantic-ref-warning {{folded to constant array}}
73+
int a2[(intptr_t)&((struct y*)0)->y]; // all-warning {{folded to constant array}}
8374

8475
const struct y *yy = (struct y*)0;
85-
const intptr_t L = (intptr_t)(&(yy->y)); // expected-error {{not a compile-time constant}} \
86-
// pedantic-expected-error {{not a compile-time constant}} \
87-
// ref-error {{not a compile-time constant}} \
88-
// pedantic-ref-error {{not a compile-time constant}}
76+
const intptr_t L = (intptr_t)(&(yy->y)); // all-error {{not a compile-time constant}}
77+
8978
const ptrdiff_t m = &m + 137 - &m;
9079
_Static_assert(m == 137, ""); // pedantic-ref-warning {{GNU extension}} \
9180
// pedantic-expected-warning {{GNU extension}}
9281

9382
/// from test/Sema/switch.c, used to cause an assertion failure.
9483
void f (int z) {
9584
while (z) {
96-
default: z--; // expected-error {{'default' statement not in switch}} \
97-
// pedantic-expected-error {{'default' statement not in switch}} \
98-
// ref-error {{'default' statement not in switch}} \
99-
// pedantic-ref-error {{'default' statement not in switch}}
85+
default: z--; // all-error {{'default' statement not in switch}}
10086
}
10187
}
10288

10389
int expr;
10490
int chooseexpr[__builtin_choose_expr(1, 1, expr)];
10591

10692
int somefunc(int i) {
107-
return (i, 65537) * 65537; // expected-warning {{left operand of comma operator has no effect}} \
108-
// expected-warning {{overflow in expression; result is 131073}} \
109-
// pedantic-expected-warning {{left operand of comma operator has no effect}} \
110-
// pedantic-expected-warning {{overflow in expression; result is 131073}} \
111-
// ref-warning {{left operand of comma operator has no effect}} \
112-
// ref-warning {{overflow in expression; result is 131073}} \
113-
// pedantic-ref-warning {{left operand of comma operator has no effect}} \
114-
// pedantic-ref-warning {{overflow in expression; result is 131073}}
115-
93+
return (i, 65537) * 65537; // all-warning {{left operand of comma operator has no effect}} \
94+
// all-warning {{overflow in expression; result is 131073}}
11695
}
11796

11897
/// FIXME: The following test is incorrect in the new interpreter.
@@ -130,7 +109,4 @@ _Static_assert(sizeof(name2) == 0, ""); // expected-error {{failed}} \
130109
// pedantic-expected-error {{failed}} \
131110
// pedantic-expected-note {{evaluates to}}
132111

133-
void *PR28739d = &(&PR28739d)[(__int128)(unsigned long)-1]; // expected-warning {{refers past the last possible element}} \
134-
// pedantic-expected-warning {{refers past the last possible element}} \
135-
// ref-warning {{refers past the last possible element}} \
136-
// pedantic-ref-warning {{refers past the last possible element}}
112+
void *PR28739d = &(&PR28739d)[(__int128)(unsigned long)-1]; // all-warning {{refers past the last possible element}}

0 commit comments

Comments
 (0)