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 _Static_assert(ONE
== 1, "ONE is not 1");
196 #elif defined test_static_assert_2
197 _Static_assert(1, "1"" is 1");
198 _Static_assert(0, "0"" is 0");
200 #elif defined test_static_assert_c2x
204 #elif defined test_void_array
207 #elif defined test_incomplete_enum_array
210 #elif defined test_incomplete_struct_array
213 #elif defined test_const_fun_array
214 typedef void f(void);
217 #elif defined test_incomplete_array_array
218 int t
[][3]; // gr: not an error, see below
220 /******************************************************************/
221 #elif defined test_extern_array
222 int iii
[] = { 1,2,3 };
233 /******************************************************************/
234 #elif defined test_func_1 \
235 || defined test_func_2 \
236 || defined test_func_3 \
237 || defined test_func_4 \
238 || defined test_func_5 \
239 || defined test_func_6
240 #if defined test_func_1
242 #elif defined test_func_4
243 static int hello(int);
246 #if defined test_func_6
253 int printf(const char*, ...);
254 #if defined test_func_3
255 static int hello(int a
)
256 #elif defined test_func_5
257 int hello(int a
, int b
)
261 { printf("%s: a = %d\n", __FUNCTION__
, a
); return 0; }
263 /******************************************************************/
264 #elif defined test_var_1 \
265 || defined test_var_2 \
266 || defined test_var_3
267 #define P(n,v) printf("%-5s: %d ; %d\n", __FUNCTION__, n, v)
268 #if defined test_var_1
272 int printf(const char*, ...);
275 #if !defined test_var_3
280 #if defined test_var_3
287 #if !defined test_var_3
294 int bar() { P(3, xxx
[0]); return 0; }
296 #elif defined test_var_4
297 struct yyy
{ int y
; };
303 extern struct yyy
*yy
;
305 extern struct zzz
*zz
;
311 extern struct yyy
*yy
;
313 extern struct zzz
*zz
;
316 struct zzz
{ int z
; } z
, *zz
;
318 /******************************************************************/
319 #elif defined test_long_double_type_for_win32
325 int n
= _Generic(*a
, double:0, long double:1);
328 #elif defined test_stray_backslash
332 #elif defined test_stray_backslash2
333 int printf(const char*, ...);
338 printf("%sn\n", S(\\));
341 /******************************************************************/
342 #elif defined test_var_array
344 static struct var_len
{ int i
; const char str
[]; } var_array
[] =
345 { { 1, "abcdefghijklmnopqrstuvwxyz" },
346 { 2, "longlonglonglonglong" },
349 #elif defined test_var_array2
351 struct c1
{ int a
; int b
[]; };
352 struct c1 c1
= { 1, { 2, 3, 4 } };
354 struct c2
{ int c
; struct c1 c1
; };
355 struct c2 c2
= { 1, { 2, { 3, 4, 5 }}};
357 #elif defined test_var_array3
358 /* similar to test_var_array2 but with string initializers */
359 struct A
{ int a
; char b
[]; };
360 struct A a
= { 1, "1" };
361 struct B
{ struct A a
; };
362 struct B b
= { { 1, "1" } };
363 /******************************************************************/
364 #elif defined test_default_int_type
368 #elif defined test_invalid_global_stmtexpr
369 n
[sizeof({3;})]; // crashed in block() due to missing local scope
371 #elif defined test_invalid_tokckill
372 f(){"12"3;} // second const token killed the value of the first
374 /******************************************************************/
375 #elif defined test_duplicate_member
379 #elif defined test_duplicate_member_anon
393 /******************************************************************/
394 #elif defined test_conflicting_array_definition
396 int array
[] = { 1, 2, 3 };
398 #elif defined test_cast_from_void
400 int f() { return v(); }
402 #elif defined test_switch_W1 || defined test_switch_W2 \
403 || defined test_switch_W3 || defined test_switch_W4
404 #if defined test_switch_W1
405 #pragma comment(option, "-Wall")
406 #elif defined test_switch_W2
407 #pragma comment(option, "-Wunsupported -Wno-implicit-function-declaration -Wstuff")
408 #elif defined test_switch_W3
409 #pragma comment(option, "-Wwrite-strings -Werror=discarded-qualifiers")
410 #elif defined test_switch_W4
411 #pragma comment(option, "-Wunsupported -Wno-error=implicit-function-declaration -Werror")
418 __attribute__((stuff
)) int fink() {return 0;}