Skip to content

Commit ab1d0c7

Browse files
committed
update tests
1 parent 2ea6de0 commit ab1d0c7

File tree

1 file changed

+34
-22
lines changed

1 file changed

+34
-22
lines changed

clang/test/Preprocessor/embed___has_embed_parsing_errors.c

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
// RUN: %clang_cc1 -std=c23 %s -E -verify
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
210

311
// Test the parsing behavior for __has_embed and all of its parameters to ensure we
412
// recover from failures gracefully.
@@ -251,34 +259,38 @@
251259
#if __has_embed("") // expected-error {{empty filename}}
252260
#endif
253261

254-
// expected-error@+9 {{unterminated conditional directive}}
255-
// expected-error@+13 {{unterminated conditional directive}}
256-
// expected-error@+17 {{unterminated conditional directive}}
257-
// expected-error@+21 {{unterminated conditional directive}}
258-
// expected-error@+25 {{unterminated conditional directive}}
259-
260-
// expected-error@+3 {{missing ')' after '__has_embed'}} \
261-
expected-error@+3 {{expected value in expression}} \
262-
expected-note@+3 {{to match this '('}}
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}}
263267
#if __has_embed (__FILE__ foo limit(1)
264268

265-
// expected-error@+3 {{missing ')' after '__has_embed'}} \
266-
expected-error@+3 {{expected value in expression}} \
267-
expected-note@+3 {{to match this '('}}
269+
//--- 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}}
268274
#if __has_embed (__FILE__ foo
269275

270-
// expected-error@+3 {{missing ')' after '__has_embed'}} \
271-
expected-error@+3 {{expected value in expression}} \
272-
expected-note@+3 {{to match this '('}}
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}}
273281
#if __has_embed ("a" foo()
274282

275-
// expected-error@+3 {{missing ')' after '__has_embed'}} \
276-
expected-error@+3 {{expected value in expression}} \
277-
expected-note@+3 {{to match this '('}}
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}}
278288
#if __has_embed ("a" bar() foo
279289

280-
// expected-error@+3 {{missing ')' after '__has_embed'}} \
281-
expected-error@+3 {{expected value in expression}} \
282-
expected-note@+3 {{to match this '('}}
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}}
283295
#if __has_embed (__FILE__ limit(1) foo
284296
int a = __has_embed (__FILE__);

0 commit comments

Comments
 (0)