1 #if defined test_56_btype_excess_1
4 #elif defined test_57_btype_excess_2
7 #elif defined test_58_function_redefinition
8 int f(void) { return 0; }
9 int f(void) { return 1; }
11 #elif defined test_global_redefinition
16 #elif defined test_59_function_array
17 int (*fct
)[42](int x
);
19 #elif defined test_60_enum_redefinition
20 enum color
{ RED
, GREEN
, BLUE
};
21 enum color
{ R
, G
, B
};
24 #elif defined test_62_enumerator_redefinition
25 enum color
{ RED
, GREEN
, BLUE
};
26 enum rgb
{ RED
, G
, B
};
29 #elif defined test_63_local_enumerator_redefinition
45 #elif defined test_61_undefined_enum
48 #elif defined test_74_non_const_init
51 #elif defined test_pointer_assignment
59 void *v1
, **v2
, ***v3
;
61 enum e1
{ a
= 4 } e10
, *e11
, *e12
;
62 enum e2
{ b
= -4 } e20
, *e21
;
63 enum e3
{ c
= 5000000000LL } e30
;
115 #elif defined test_enum_compat
121 #elif defined test_enum_compat_2
122 enum e6
{ E1
= -1, E0
};
124 void f3(int); // should work as int and e6 are compatible
126 void f4(unsigned e
); // should error as unsigned and e6 are incompatible
128 #elif defined test_ptr_to_str
129 void f() { _Generic((int const *[]){0}, int:0); }
130 #elif defined test_fnptr_to_str
131 void f() { _Generic((int (*(*)(float,char))(double,int)){0}, int:0); }
132 #elif defined test_array_to_str
133 void f() { _Generic((int(*)[3]){0}, int:0); }
134 #elif defined test_duplicate_def_1
135 static enum myenum
{ L
= -1 } L
;
136 #elif defined test_duplicate_def_2
138 static enum myenum
{ L
= -1 } L
;
140 #elif defined test_abstract_decls
141 int bar(const char *()); // abstract declarator here is okay
142 int bar (const char *(*g
)()) // should match this 'g' argument
147 int foo(int ()) // abstract decl is wrong in definitions
150 #elif defined test_invalid_1
155 #elif defined test_invalid_2
157 #elif defined test_invalid_3
158 struct S
{ int a
, b
; };
159 struct T
{ struct S x
; };
160 struct T gt
= { 42 a
: 1, 43 };
161 #elif defined test_invalid_4
165 #elif defined test_conflicting_types
174 #elif defined test_nested_types
180 #elif defined test_vla_1
186 #elif defined test_invalid_alignas
187 /* _Alignas is no type qualifier */
188 void * _Alignas(16) p1
;
190 #elif defined test_static_assert
193 _Static_assert(ONE
== 0, "don't show me this");
194 struct x
{ _Static_assert(ONE
== 1, "ONE is not 1"); };
196 #elif defined test_static_assert_2
197 _Static_assert(1, "1"" is 1");
198 struct y
{ _Static_assert(0, "0"" is 0"); };
200 #elif defined test_static_assert_c2x
202 struct z
{ _Static_assert(0); }
204 #elif defined test_static_assert_empty_string
205 _Static_assert(0,"");
207 #elif defined test_void_array
210 #elif defined test_incomplete_enum_array
213 #elif defined test_incomplete_struct_array
216 #elif defined test_const_fun_array
217 typedef void f(void);
220 #elif defined test_incomplete_array_array
221 int t
[][3]; // gr: not an error, see below
223 /******************************************************************/
224 #elif defined test_extern_array
225 int iii
[] = { 1,2,3 };
236 /******************************************************************/
237 #elif defined test_func_1 \
238 || defined test_func_2 \
239 || defined test_func_3 \
240 || defined test_func_4 \
241 || defined test_func_5 \
242 || defined test_func_6
243 #if defined test_func_1
245 #elif defined test_func_4
246 static int hello(int);
249 #if defined test_func_6
256 int printf(const char*, ...);
257 #if defined test_func_3
258 static int hello(int a
)
259 #elif defined test_func_5
260 int hello(int a
, int b
)
264 { printf("%s: a = %d\n", __FUNCTION__
, a
); return 0; }
266 /******************************************************************/
267 #elif defined test_var_1 \
268 || defined test_var_2 \
269 || defined test_var_3
270 #define P(n,v) printf("%-5s: %d ; %d\n", __FUNCTION__, n, v)
271 #if defined test_var_1
275 int printf(const char*, ...);
278 #if !defined test_var_3
283 #if defined test_var_3
290 #if !defined test_var_3
297 int bar() { P(3, xxx
[0]); return 0; }
299 #elif defined test_var_4
300 struct yyy
{ int y
; };
306 extern struct yyy
*yy
;
308 extern struct zzz
*zz
;
314 extern struct yyy
*yy
;
316 extern struct zzz
*zz
;
319 struct zzz
{ int z
; } z
, *zz
;
321 /******************************************************************/
322 #elif defined test_long_double_type_for_win32
328 int n
= _Generic(*a
, double:0, long double:1);
331 #elif defined test_stray_backslash
335 #elif defined test_stray_backslash2
336 int printf(const char*, ...);
341 printf("%sn\n", S(\\));
344 /******************************************************************/
345 #elif defined test_var_array
347 static struct var_len
{ int i
; const char str
[]; } var_array
[] =
348 { { 1, "abcdefghijklmnopqrstuvwxyz" },
349 { 2, "longlonglonglonglong" },
352 #elif defined test_var_array2
354 struct c1
{ int a
; int b
[]; };
355 struct c1 c1
= { 1, { 2, 3, 4 } };
357 struct c2
{ int c
; struct c1 c1
; };
358 struct c2 c2
= { 1, { 2, { 3, 4, 5 }}};
360 #elif defined test_var_array3
361 /* similar to test_var_array2 but with string initializers */
362 struct A
{ int a
; char b
[]; };
363 struct A a
= { 1, "1" };
364 struct B
{ struct A a
; };
365 struct B b
= { { 1, "1" } };
366 /******************************************************************/
367 #elif defined test_default_int_type
371 #elif defined test_invalid_global_stmtexpr
372 n
[sizeof({3;})]; // crashed in block() due to missing local scope
374 #elif defined test_invalid_tokckill
375 f(){"12"3;} // second const token killed the value of the first
377 /******************************************************************/
378 #elif defined test_duplicate_member
382 #elif defined test_duplicate_member_anon
396 /******************************************************************/
397 #elif defined test_conflicting_array_definition
399 int array
[] = { 1, 2, 3 };
401 #elif defined test_incompatible_local_redef
404 typedef int localfunctype (int);
405 extern localfunctype func2
;
406 typedef void localfunctype (int, int);
409 #elif defined test_cast_from_void
411 int f() { return v(); }
413 #elif defined test_switch_W1 || defined test_switch_W2 \
414 || defined test_switch_W3 || defined test_switch_W4
415 #if defined test_switch_W1
416 #pragma comment(option, "-Wall")
417 #elif defined test_switch_W2
418 #pragma comment(option, "-Wunsupported -Wno-implicit-function-declaration -Wstuff")
419 #elif defined test_switch_W3
420 #pragma comment(option, "-Wwrite-strings -Werror=discarded-qualifiers")
421 #elif defined test_switch_W4
422 #pragma comment(option, "-Wunsupported -Wno-error=implicit-function-declaration -Werror")
429 __attribute__((stuff
)) int fink() {return 0;}
431 #elif defined test_invalid_funcparam_1
432 void func(int a
, int b
, int a
);
434 #elif defined test_invalid_funcparam_2
435 void func(int a
, int if);
437 #elif defined test_array_funcparam
438 int amain(int argc
, char *argv
[static argc
+ 1])
441 int printf(const char*, ...);
442 for (i
= 0; i
< argc
; ++i
)
443 printf("arg[%d] = \"%s\"\n", i
, argv
[i
]);
448 return amain(2, (char *[]){ "X", "Y", 0 });
451 #elif defined test_return_from_statement_expr
452 int f() { ({ return 78; }); }
453 int main() { return f(); }
455 /******************************************************************/
457 #elif defined test_illegal_unicode
459 char *str
= "\Uffffffff";
462 #elif defined test_error_string
466 #elif defined test_error_incomplete_type
479 #elif defined test_pp_error_1
482 #elif defined test_pp_error_2
483 # if X(1,2) //undefined function macro