|
1 | | -// RUN: split-file %s %t |
2 | | -// RUN: %clang_cc1 -std=c23 -E -verify %t/test1.c |
3 | | -// RUN: %clang_cc1 -std=c23 -E -verify %t/test2.c |
4 | | -// RUN: %clang_cc1 -std=c23 -E -verify %t/test3.c |
5 | | -// RUN: %clang_cc1 -std=c23 -E -verify %t/test4.c |
6 | | -// RUN: %clang_cc1 -std=c23 -E -verify %t/test5.c |
7 | | -// RUN: %clang_cc1 -std=c23 -E -verify %t/test6.c |
8 | | - |
9 | | -//--- test1.c |
| 1 | +// RUN: %clang_cc1 -std=c23 %s -E -verify |
10 | 2 |
|
11 | 3 | // Test the parsing behavior for __has_embed and all of its parameters to ensure we |
12 | 4 | // recover from failures gracefully. |
|
259 | 251 | #if __has_embed("") // expected-error {{empty filename}} |
260 | 252 | #endif |
261 | 253 |
|
262 | | -//--- test2.c |
263 | | -// expected-error@+4 {{missing ')' after '__has_embed'}} \ |
264 | | - expected-error@+4 {{expected value in expression}} \ |
265 | | - expected-note@+4 {{to match this '('}} \ |
266 | | - expected-error@+4 {{unterminated conditional directive}} |
| 254 | +// expected-error@+3 {{missing ')' after '__has_embed'}} \ |
| 255 | + expected-error@+3 {{expected value in expression}} \ |
| 256 | + expected-note@+3 {{to match this '('}} |
267 | 257 | #if __has_embed (__FILE__ foo limit(1) |
| 258 | +#endif |
268 | 259 |
|
269 | 260 | //--- test3.c |
270 | | -// expected-error@+4 {{missing ')' after '__has_embed'}} \ |
271 | | - expected-error@+4 {{expected value in expression}} \ |
272 | | - expected-note@+4 {{to match this '('}} \ |
273 | | - expected-error@+4 {{unterminated conditional directive}} |
| 261 | +// expected-error@+3 {{missing ')' after '__has_embed'}} \ |
| 262 | + expected-error@+3 {{expected value in expression}} \ |
| 263 | + expected-note@+3 {{to match this '('}} |
274 | 264 | #if __has_embed (__FILE__ foo |
| 265 | +#endif |
275 | 266 |
|
276 | | -//--- test4.c |
277 | | -// expected-error@+4 {{missing ')' after '__has_embed'}} \ |
278 | | - expected-error@+4 {{expected value in expression}} \ |
279 | | - expected-note@+4 {{to match this '('}} \ |
280 | | - expected-error@+4 {{unterminated conditional directive}} |
| 267 | +// expected-error@+3 {{missing ')' after '__has_embed'}} \ |
| 268 | + expected-error@+3 {{expected value in expression}} \ |
| 269 | + expected-note@+3 {{to match this '('}} |
281 | 270 | #if __has_embed ("a" foo() |
| 271 | +#endif |
282 | 272 |
|
283 | | -//--- test5.c |
284 | | -// expected-error@+4 {{missing ')' after '__has_embed'}} \ |
285 | | - expected-error@+4 {{expected value in expression}} \ |
286 | | - expected-note@+4 {{to match this '('}} \ |
287 | | - expected-error@+4 {{unterminated conditional directive}} |
| 273 | +// expected-error@+3 {{missing ')' after '__has_embed'}} \ |
| 274 | + expected-error@+3 {{expected value in expression}} \ |
| 275 | + expected-note@+3 {{to match this '('}} |
288 | 276 | #if __has_embed ("a" bar() foo |
| 277 | +#endif |
289 | 278 |
|
290 | | -//--- test6.c |
291 | | -// expected-error@+4 {{missing ')' after '__has_embed'}} \ |
292 | | - expected-error@+4 {{expected value in expression}} \ |
293 | | - expected-note@+4 {{to match this '('}} \ |
294 | | - expected-error@+4 {{unterminated conditional directive}} |
| 279 | +// expected-error@+3 {{missing ')' after '__has_embed'}} \ |
| 280 | + expected-error@+3 {{expected value in expression}} \ |
| 281 | + expected-note@+3 {{to match this '('}} |
295 | 282 | #if __has_embed (__FILE__ limit(1) foo |
296 | 283 | int a = __has_embed (__FILE__); |
| 284 | +#endif |
0 commit comments