Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / gcc.dg / missing-symbol-3.c
blob5c7aaed6a2735567d52936b11ba961d2160d3ea8
1 /* { dg-options "-fdiagnostics-show-caret" } */
3 /* A sequence of bogus _Static_assert.
4 We can offer fix-it hints for some of these, but not all. */
6 void test_static_assert_1 (void)
8 _Static_assert sizeof(int) >= sizeof(char); /* { dg-error "expected '\\(' before 'sizeof'" } */
9 /* { dg-begin-multiline-output "" }
10 _Static_assert sizeof(int) >= sizeof(char);
11 ^~~~~~
13 { dg-end-multiline-output "" } */
16 void test_static_assert_2 (void)
18 _Static_assert(sizeof(int) >= sizeof(char); /* { dg-error "expected '\\)' before ';' token" } */
19 /* { dg-begin-multiline-output "" }
20 _Static_assert(sizeof(int) >= sizeof(char);
21 ~ ^
23 { dg-end-multiline-output "" } */
26 void test_static_assert_3 (void)
28 _Static_assert(sizeof(int) >= sizeof(char),; /* { dg-error "expected string literal before ';' token" } */
29 /* { dg-begin-multiline-output "" }
30 _Static_assert(sizeof(int) >= sizeof(char),;
32 { dg-end-multiline-output "" } */
35 void test_static_assert_4 (void)
37 _Static_assert(sizeof(int) >= sizeof(char), "msg"; /* { dg-error "expected '\\)' before ';' token" } */
38 /* { dg-begin-multiline-output "" }
39 _Static_assert(sizeof(int) >= sizeof(char), "msg";
40 ~ ^
42 { dg-end-multiline-output "" } */
45 /* The final one is correct. */
47 void test_static_assert_5 (void)
49 _Static_assert(sizeof(int) >= sizeof(char), "msg");