Imported Upstream version 2.9.0
[debian/cc1111] / support / valdiag / tests / struct.c
1
2 #ifdef TEST1
3 struct tag {
4   int good1;
5   register int bad;     /* ERROR */
6   int good2;
7 } badstruct;            /* IGNORE */
8 #endif
9
10 #ifdef TEST2
11 struct tag {
12   int good1;
13   int bad;      /* IGNORE */
14   int bad;      /* ERROR */
15   int good2;
16 } badstruct;
17 #endif
18
19
20 #ifdef TEST3
21 struct tag {
22   int good1;
23   int bad:255;  /* ERROR */
24   int good2;
25 } badstruct;
26 #endif
27
28 #ifdef TEST4
29 struct tag {
30   int good1;
31   int good2;
32 } goodstruct1;
33
34 struct tag goodstruct2;
35 #endif
36
37 #ifdef TEST5a
38 struct tag {
39   int good1;
40   int good2;
41 } goodstruct1;
42
43 union tag badunion;     /* ERROR */
44 #endif
45
46 #ifdef TEST5b
47 union tag {
48   int good1;
49   int good2;
50 } goodunion1;
51
52 struct tag badstruct;   /* ERROR */
53 #endif
54
55
56 #ifdef TEST6
57 struct linklist {
58   struct linklist *prev;
59   struct linklist *next;
60   int x;
61 } ll;
62 #endif
63
64 #ifdef TEST7a
65 union tag {
66   struct tag *next;     /* ERROR */
67   int x;
68 } ll;
69 #endif
70
71 #ifdef TEST7b
72 struct tag {
73   union tag *next;      /* ERROR */
74   int x;
75 } ll;
76 #endif
77
78 #ifdef TEST8a
79 struct tag {
80   int a;                /* IGNORE */
81   struct {
82     int a;              /* ERROR(SDCC) */ /* IGNORE(GCC) */
83     int b;
84   };
85 } ll;  
86 #endif
87
88 #ifdef TEST8b
89 struct tag {
90   int a;
91   struct {
92     int b;
93     int c;
94   };
95 } ll;  
96
97 void test(void)
98 {
99   ll.a = 1;
100   ll.b = 2;
101   ll.c = 3;
102 }
103
104 #endif