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
5
5
6
6
typedef __INTPTR_TYPE__ intptr_t ;
7
7
typedef __PTRDIFF_TYPE__ ptrdiff_t ;
@@ -22,10 +22,7 @@ _Static_assert(!!1.0, ""); // pedantic-ref-warning {{not an integer constant exp
22
22
_Static_assert (!!1 , "" );
23
23
24
24
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}}
29
26
30
27
31
28
const int b = 3 ;
@@ -67,52 +64,34 @@ _Static_assert((&a - 100) != 0, ""); // pedantic-ref-warning {{is a GNU extensio
67
64
/// extern variable of a composite type.
68
65
/// FIXME: The 'cast from void*' note is missing in the new interpreter.
69
66
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}} \
72
68
// pedantic-ref-warning {{is a GNU extension}} \
73
69
// pedantic-ref-note {{cast from 'void *' is not allowed}} \
74
- // expected-warning {{always true}} \
75
- // pedantic-expected-warning {{always true}} \
76
70
// pedantic-expected-warning {{is a GNU extension}}
77
71
78
72
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}}
83
74
84
75
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
+
89
78
const ptrdiff_t m = & m + 137 - & m ;
90
79
_Static_assert (m == 137 , "" ); // pedantic-ref-warning {{GNU extension}} \
91
80
// pedantic-expected-warning {{GNU extension}}
92
81
93
82
/// from test/Sema/switch.c, used to cause an assertion failure.
94
83
void f (int z ) {
95
84
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}}
100
86
}
101
87
}
102
88
103
89
int expr ;
104
90
int chooseexpr [__builtin_choose_expr (1 , 1 , expr )];
105
91
106
92
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}}
116
95
}
117
96
118
97
/// FIXME: The following test is incorrect in the new interpreter.
@@ -130,7 +109,4 @@ _Static_assert(sizeof(name2) == 0, ""); // expected-error {{failed}} \
130
109
// pedantic-expected-error {{failed}} \
131
110
// pedantic-expected-note {{evaluates to}}
132
111
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