Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / support / valdiag / tests / struct.c
blob6846b413566c0ba58a5aa0a3a9c8da0258f87d34
2 #ifdef TEST1
3 struct tag {
4 int good1;
5 register int bad; /* ERROR */
6 int good2;
7 } badstruct; /* IGNORE */
8 #endif
10 #ifdef TEST2
11 struct tag {
12 int good1;
13 int bad; /* IGNORE */
14 int bad; /* ERROR */
15 int good2;
16 } badstruct;
17 #endif
19 #ifdef TEST3a
20 struct tag {
21 int good1;
22 int bad:255; /* ERROR */
23 int good2;
24 } badstruct;
25 #endif
27 #ifdef TEST3b
28 struct tag {
29 int good1;
30 float badtype1 : 5; /* ERROR */
31 int good2;
32 _Bool badwidth2 : 2; /* ERROR */
33 int good3;
34 int badwidth2 : 17; /* ERROR */
35 int good4;
36 } badstruct;
37 #endif
39 #ifdef TEST4
40 struct tag {
41 int good1;
42 int good2;
43 } goodstruct1;
45 struct tag goodstruct2;
46 #endif
48 #ifdef TEST5a
49 struct tag {
50 int good1;
51 int good2;
52 } goodstruct1;
54 union tag badunion; /* ERROR */
55 #endif
57 #ifdef TEST5b
58 union tag {
59 int good1;
60 int good2;
61 } goodunion1;
63 struct tag badstruct; /* ERROR */
64 #endif
67 #ifdef TEST6
68 struct linklist {
69 struct linklist *prev;
70 struct linklist *next;
71 int x;
72 } ll;
73 #endif
75 #ifdef TEST7a
76 union tag {
77 struct tag *next; /* ERROR */
78 int x;
79 } ll;
80 #endif
82 #ifdef TEST7b
83 struct tag {
84 union tag *next; /* ERROR */
85 int x;
86 } ll;
87 #endif
89 #ifdef TEST8a
90 struct tag {
91 int a; /* IGNORE */
92 struct {
93 int a; /* ERROR(SDCC) */ /* IGNORE(GCC) */
94 int b;
96 } ll;
97 #endif
99 #ifdef TEST8b
100 struct tag {
101 int a;
102 struct {
103 int b;
104 int c;
106 } ll;
108 void test(void)
110 ll.a = 1;
111 ll.b = 2;
112 ll.c = 3;
115 #endif
117 /* bug 3086: SDCC had infinite loop on this error */
118 #ifdef TEST9
119 struct tag1 {
120 union {
121 struct tag2; /* ERROR(SDCC) */ /* IGNORE(GCC) */
122 } tag3; /* IGNORE */
124 #endif
126 // C23 allows multiple compatible definitions for struct.
127 #ifdef TEST10
128 #ifdef __SDCC
129 #pragma std_c23
130 #endif
132 struct A {int x; int y;}; /* IGNORE */
133 struct A {int x; int y;}; /* IGNORE(GCC) */
134 struct A {int x; int z;}; /* ERROR */
136 #endif