Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/990326-1.c

raw
1 void abort (void);
2 void exit (int);
3
4 struct a {
5 char a, b;
6 short c;
7 };
8
9 int
10 a1()
11 {
12 static struct a x = { 1, 2, ~1 }, y = { 65, 2, ~2 };
13
14 return (x.a == (y.a & ~64) && x.b == y.b);
15 }
16
17 int
18 a2()
19 {
20 static struct a x = { 1, 66, ~1 }, y = { 1, 2, ~2 };
21
22 return (x.a == y.a && (x.b & ~64) == y.b);
23 }
24
25 int
26 a3()
27 {
28 static struct a x = { 9, 66, ~1 }, y = { 33, 18, ~2 };
29
30 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
31 }
32
33 struct b {
34 int c;
35 short b, a;
36 };
37
38 int
39 b1()
40 {
41 static struct b x = { ~1, 2, 1 }, y = { ~2, 2, 65 };
42
43 return (x.a == (y.a & ~64) && x.b == y.b);
44 }
45
46 int
47 b2()
48 {
49 static struct b x = { ~1, 66, 1 }, y = { ~2, 2, 1 };
50
51 return (x.a == y.a && (x.b & ~64) == y.b);
52 }
53
54 int
55 b3()
56 {
57 static struct b x = { ~1, 66, 9 }, y = { ~2, 18, 33 };
58
59 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
60 }
61
62 struct c {
63 unsigned int c:4, b:14, a:14;
64 } __attribute__ ((aligned));
65
66 int
67 c1()
68 {
69 static struct c x = { ~1, 2, 1 }, y = { ~2, 2, 65 };
70
71 return (x.a == (y.a & ~64) && x.b == y.b);
72 }
73
74 int
75 c2()
76 {
77 static struct c x = { ~1, 66, 1 }, y = { ~2, 2, 1 };
78
79 return (x.a == y.a && (x.b & ~64) == y.b);
80 }
81
82 int
83 c3()
84 {
85 static struct c x = { ~1, 66, 9 }, y = { ~2, 18, 33 };
86
87 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
88 }
89
90 struct d {
91 unsigned int a:14, b:14, c:4;
92 } __attribute__ ((aligned));
93
94 int
95 d1()
96 {
97 static struct d x = { 1, 2, ~1 }, y = { 65, 2, ~2 };
98
99 return (x.a == (y.a & ~64) && x.b == y.b);
100 }
101
102 int
103 d2()
104 {
105 static struct d x = { 1, 66, ~1 }, y = { 1, 2, ~2 };
106
107 return (x.a == y.a && (x.b & ~64) == y.b);
108 }
109
110 int
111 d3()
112 {
113 static struct d x = { 9, 66, ~1 }, y = { 33, 18, ~2 };
114
115 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
116 }
117
118 struct e {
119 int c:4, b:14, a:14;
120 } __attribute__ ((aligned));
121
122 int
123 e1()
124 {
125 static struct e x = { ~1, -2, -65 }, y = { ~2, -2, -1 };
126
127 return (x.a == (y.a & ~64) && x.b == y.b);
128 }
129
130 int
131 e2()
132 {
133 static struct e x = { ~1, -2, -1 }, y = { ~2, -66, -1 };
134
135 return (x.a == y.a && (x.b & ~64) == y.b);
136 }
137
138 int
139 e3()
140 {
141 static struct e x = { ~1, -18, -33 }, y = { ~2, -66, -9 };
142
143 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
144 }
145
146 int
147 e4()
148 {
149 static struct e x = { -1, -1, 0 };
150
151 return x.a == 0 && x.b & 0x2000;
152 }
153
154 struct f {
155 int a:14, b:14, c:4;
156 } __attribute__ ((aligned));
157
158 int
159 f1()
160 {
161 static struct f x = { -65, -2, ~1 }, y = { -1, -2, ~2 };
162
163 return (x.a == (y.a & ~64) && x.b == y.b);
164 }
165
166 int
167 f2()
168 {
169 static struct f x = { -1, -2, ~1 }, y = { -1, -66, ~2 };
170
171 return (x.a == y.a && (x.b & ~64) == y.b);
172 }
173
174 int
175 f3()
176 {
177 static struct f x = { -33, -18, ~1 }, y = { -9, -66, ~2 };
178
179 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
180 }
181
182 int
183 f4()
184 {
185 static struct f x = { 0, -1, -1 };
186
187 return x.a == 0 && x.b & 0x2000;
188 }
189
190 struct gx {
191 int c:4, b:14, a:14;
192 } __attribute__ ((aligned));
193 struct gy {
194 int b:14, a:14, c:4;
195 } __attribute__ ((aligned));
196
197 int
198 g1()
199 {
200 static struct gx x = { ~1, -2, -65 };
201 static struct gy y = { -2, -1, ~2 };
202
203 return (x.a == (y.a & ~64) && x.b == y.b);
204 }
205
206 int
207 g2()
208 {
209 static struct gx x = { ~1, -2, -1 };
210 static struct gy y = { -66, -1, ~2 };
211
212 return (x.a == y.a && (x.b & ~64) == y.b);
213 }
214
215 int
216 g3()
217 {
218 static struct gx x = { ~1, -18, -33 };
219 static struct gy y = { -66, -9, ~2 };
220
221 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
222 }
223
224 int
225 g4()
226 {
227 static struct gx x = { ~1, 0x0020, 0x0010 };
228 static struct gy y = { 0x0200, 0x0100, ~2 };
229
230 return ((x.a & 0x00f0) == (y.a & 0x0f00) &&
231 (x.b & 0x00f0) == (y.b & 0x0f00));
232 }
233
234 int
235 g5()
236 {
237 static struct gx x = { ~1, 0x0200, 0x0100 };
238 static struct gy y = { 0x0020, 0x0010, ~2 };
239
240 return ((x.a & 0x0f00) == (y.a & 0x00f0) &&
241 (x.b & 0x0f00) == (y.b & 0x00f0));
242 }
243
244 int
245 g6()
246 {
247 static struct gx x = { ~1, 0xfe20, 0xfd10 };
248 static struct gy y = { 0xc22f, 0xc11f, ~2 };
249
250 return ((x.a & 0x03ff) == (y.a & 0x3ff0) &&
251 (x.b & 0x03ff) == (y.b & 0x3ff0));
252 }
253
254 int
255 g7()
256 {
257 static struct gx x = { ~1, 0xc22f, 0xc11f };
258 static struct gy y = { 0xfe20, 0xfd10, ~2 };
259
260 return ((x.a & 0x3ff0) == (y.a & 0x03ff) &&
261 (x.b & 0x3ff0) == (y.b & 0x03ff));
262 }
263
264 struct hx {
265 int a:14, b:14, c:4;
266 } __attribute__ ((aligned));
267 struct hy {
268 int c:4, a:14, b:14;
269 } __attribute__ ((aligned));
270
271 int
272 h1()
273 {
274 static struct hx x = { -65, -2, ~1 };
275 static struct hy y = { ~2, -1, -2 };
276
277 return (x.a == (y.a & ~64) && x.b == y.b);
278 }
279
280 int
281 h2()
282 {
283 static struct hx x = { -1, -2, ~1 };
284 static struct hy y = { ~2, -1, -66 };
285
286 return (x.a == y.a && (x.b & ~64) == y.b);
287 }
288
289 int
290 h3()
291 {
292 static struct hx x = { -33, -18, ~1 };
293 static struct hy y = { ~2, -9, -66 };
294
295 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
296 }
297
298 int
299 h4()
300 {
301 static struct hx x = { 0x0010, 0x0020, ~1 };
302 static struct hy y = { ~2, 0x0100, 0x0200 };
303
304 return ((x.a & 0x00f0) == (y.a & 0x0f00) &&
305 (x.b & 0x00f0) == (y.b & 0x0f00));
306 }
307
308 int
309 h5()
310 {
311 static struct hx x = { 0x0100, 0x0200, ~1 };
312 static struct hy y = { ~2, 0x0010, 0x0020 };
313
314 return ((x.a & 0x0f00) == (y.a & 0x00f0) &&
315 (x.b & 0x0f00) == (y.b & 0x00f0));
316 }
317
318 int
319 h6()
320 {
321 static struct hx x = { 0xfd10, 0xfe20, ~1 };
322 static struct hy y = { ~2, 0xc11f, 0xc22f };
323
324 return ((x.a & 0x03ff) == (y.a & 0x3ff0) &&
325 (x.b & 0x03ff) == (y.b & 0x3ff0));
326 }
327
328 int
329 h7()
330 {
331 static struct hx x = { 0xc11f, 0xc22f, ~1 };
332 static struct hy y = { ~2, 0xfd10, 0xfe20 };
333
334 return ((x.a & 0x3ff0) == (y.a & 0x03ff) &&
335 (x.b & 0x3ff0) == (y.b & 0x03ff));
336 }
337
338 int
339 main()
340 {
341 if (!a1 ())
342 abort ();
343 if (!a2 ())
344 abort ();
345 if (!a3 ())
346 abort ();
347 if (!b1 ())
348 abort ();
349 if (!b2 ())
350 abort ();
351 if (!b3 ())
352 abort ();
353 if (!c1 ())
354 abort ();
355 if (!c2 ())
356 abort ();
357 if (!c3 ())
358 abort ();
359 if (!d1 ())
360 abort ();
361 if (!d2 ())
362 abort ();
363 if (!d3 ())
364 abort ();
365 if (!e1 ())
366 abort ();
367 if (!e2 ())
368 abort ();
369 if (!e3 ())
370 abort ();
371 if (!e4 ())
372 abort ();
373 if (!f1 ())
374 abort ();
375 if (!f2 ())
376 abort ();
377 if (!f3 ())
378 abort ();
379 if (!f4 ())
380 abort ();
381 if (!g1 ())
382 abort ();
383 if (!g2 ())
384 abort ();
385 if (!g3 ())
386 abort ();
387 if (g4 ())
388 abort ();
389 if (g5 ())
390 abort ();
391 if (!g6 ())
392 abort ();
393 if (!g7 ())
394 abort ();
395 if (!h1 ())
396 abort ();
397 if (!h2 ())
398 abort ();
399 if (!h3 ())
400 abort ();
401 if (h4 ())
402 abort ();
403 if (h5 ())
404 abort ();
405 if (!h6 ())
406 abort ();
407 if (!h7 ())
408 abort ();
409 exit (0);
410 }