tccgen: Allow struct init from struct
[tinycc.git] / tests / bug.c
blobd4e61bcc7ada74698a87f41fd20e47302a9f6597
1 #include <stdio.h>
2 #include <stdarg.h>
4 int compile_errors(void)
6 #if TEST == 1
8 /* Not constant */
9 static int i = (&"Foobar"[1] - &"Foobar"[0]);
11 #endif
12 #if TEST == 2
14 /* Not constant */
15 struct{int c;}v;
16 static long i=((char*)&(v.c)-(char*)&v);
18 #endif
19 #if TEST == 3
21 /* Not constant */
22 static const short ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
23 void *p = &&l1 + ar[0];
24 goto *p;
25 l1: return 1;
26 l2: return 2;
28 #endif
29 #if TEST == 4
31 /* Only integer allowed */
32 __builtin_return_address(0 + 1) != NULL;
34 #endif
35 return 0;
38 int
39 main(void)