PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 990326-1.c
blobd7427cf85122b1172e29cc9f39bae54fd9a7d300
1 struct a {
2 char a, b;
3 short c;
4 };
6 int
7 a1()
9 static struct a x = { 1, 2, ~1 }, y = { 65, 2, ~2 };
11 return (x.a == (y.a & ~64) && x.b == y.b);
14 int
15 a2()
17 static struct a x = { 1, 66, ~1 }, y = { 1, 2, ~2 };
19 return (x.a == y.a && (x.b & ~64) == y.b);
22 int
23 a3()
25 static struct a x = { 9, 66, ~1 }, y = { 33, 18, ~2 };
27 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
30 struct b {
31 int c;
32 short b, a;
35 int
36 b1()
38 static struct b x = { ~1, 2, 1 }, y = { ~2, 2, 65 };
40 return (x.a == (y.a & ~64) && x.b == y.b);
43 int
44 b2()
46 static struct b x = { ~1, 66, 1 }, y = { ~2, 2, 1 };
48 return (x.a == y.a && (x.b & ~64) == y.b);
51 int
52 b3()
54 static struct b x = { ~1, 66, 9 }, y = { ~2, 18, 33 };
56 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
59 struct c {
60 unsigned int c:4, b:14, a:14;
61 } __attribute__ ((aligned));
63 int
64 c1()
66 static struct c x = { ~1, 2, 1 }, y = { ~2, 2, 65 };
68 return (x.a == (y.a & ~64) && x.b == y.b);
71 int
72 c2()
74 static struct c x = { ~1, 66, 1 }, y = { ~2, 2, 1 };
76 return (x.a == y.a && (x.b & ~64) == y.b);
79 int
80 c3()
82 static struct c x = { ~1, 66, 9 }, y = { ~2, 18, 33 };
84 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
87 struct d {
88 unsigned int a:14, b:14, c:4;
89 } __attribute__ ((aligned));
91 int
92 d1()
94 static struct d x = { 1, 2, ~1 }, y = { 65, 2, ~2 };
96 return (x.a == (y.a & ~64) && x.b == y.b);
99 int
100 d2()
102 static struct d x = { 1, 66, ~1 }, y = { 1, 2, ~2 };
104 return (x.a == y.a && (x.b & ~64) == y.b);
108 d3()
110 static struct d x = { 9, 66, ~1 }, y = { 33, 18, ~2 };
112 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
115 struct e {
116 int c:4, b:14, a:14;
117 } __attribute__ ((aligned));
120 e1()
122 static struct e x = { ~1, -2, -65 }, y = { ~2, -2, -1 };
124 return (x.a == (y.a & ~64) && x.b == y.b);
128 e2()
130 static struct e x = { ~1, -2, -1 }, y = { ~2, -66, -1 };
132 return (x.a == y.a && (x.b & ~64) == y.b);
136 e3()
138 static struct e x = { ~1, -18, -33 }, y = { ~2, -66, -9 };
140 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
144 e4()
146 static struct e x = { -1, -1, 0 };
148 return x.a == 0 && x.b & 0x2000;
151 struct f {
152 int a:14, b:14, c:4;
153 } __attribute__ ((aligned));
156 f1()
158 static struct f x = { -65, -2, ~1 }, y = { -1, -2, ~2 };
160 return (x.a == (y.a & ~64) && x.b == y.b);
164 f2()
166 static struct f x = { -1, -2, ~1 }, y = { -1, -66, ~2 };
168 return (x.a == y.a && (x.b & ~64) == y.b);
172 f3()
174 static struct f x = { -33, -18, ~1 }, y = { -9, -66, ~2 };
176 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
180 f4()
182 static struct f x = { 0, -1, -1 };
184 return x.a == 0 && x.b & 0x2000;
187 struct gx {
188 int c:4, b:14, a:14;
189 } __attribute__ ((aligned));
190 struct gy {
191 int b:14, a:14, c:4;
192 } __attribute__ ((aligned));
195 g1()
197 static struct gx x = { ~1, -2, -65 };
198 static struct gy y = { -2, -1, ~2 };
200 return (x.a == (y.a & ~64) && x.b == y.b);
204 g2()
206 static struct gx x = { ~1, -2, -1 };
207 static struct gy y = { -66, -1, ~2 };
209 return (x.a == y.a && (x.b & ~64) == y.b);
213 g3()
215 static struct gx x = { ~1, -18, -33 };
216 static struct gy y = { -66, -9, ~2 };
218 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
222 g4()
224 static struct gx x = { ~1, 0x0020, 0x0010 };
225 static struct gy y = { 0x0200, 0x0100, ~2 };
227 return ((x.a & 0x00f0) == (y.a & 0x0f00) &&
228 (x.b & 0x00f0) == (y.b & 0x0f00));
232 g5()
234 static struct gx x = { ~1, 0x0200, 0x0100 };
235 static struct gy y = { 0x0020, 0x0010, ~2 };
237 return ((x.a & 0x0f00) == (y.a & 0x00f0) &&
238 (x.b & 0x0f00) == (y.b & 0x00f0));
242 g6()
244 static struct gx x = { ~1, 0xfe20, 0xfd10 };
245 static struct gy y = { 0xc22f, 0xc11f, ~2 };
247 return ((x.a & 0x03ff) == (y.a & 0x3ff0) &&
248 (x.b & 0x03ff) == (y.b & 0x3ff0));
252 g7()
254 static struct gx x = { ~1, 0xc22f, 0xc11f };
255 static struct gy y = { 0xfe20, 0xfd10, ~2 };
257 return ((x.a & 0x3ff0) == (y.a & 0x03ff) &&
258 (x.b & 0x3ff0) == (y.b & 0x03ff));
261 struct hx {
262 int a:14, b:14, c:4;
263 } __attribute__ ((aligned));
264 struct hy {
265 int c:4, a:14, b:14;
266 } __attribute__ ((aligned));
269 h1()
271 static struct hx x = { -65, -2, ~1 };
272 static struct hy y = { ~2, -1, -2 };
274 return (x.a == (y.a & ~64) && x.b == y.b);
278 h2()
280 static struct hx x = { -1, -2, ~1 };
281 static struct hy y = { ~2, -1, -66 };
283 return (x.a == y.a && (x.b & ~64) == y.b);
287 h3()
289 static struct hx x = { -33, -18, ~1 };
290 static struct hy y = { ~2, -9, -66 };
292 return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16));
296 h4()
298 static struct hx x = { 0x0010, 0x0020, ~1 };
299 static struct hy y = { ~2, 0x0100, 0x0200 };
301 return ((x.a & 0x00f0) == (y.a & 0x0f00) &&
302 (x.b & 0x00f0) == (y.b & 0x0f00));
306 h5()
308 static struct hx x = { 0x0100, 0x0200, ~1 };
309 static struct hy y = { ~2, 0x0010, 0x0020 };
311 return ((x.a & 0x0f00) == (y.a & 0x00f0) &&
312 (x.b & 0x0f00) == (y.b & 0x00f0));
316 h6()
318 static struct hx x = { 0xfd10, 0xfe20, ~1 };
319 static struct hy y = { ~2, 0xc11f, 0xc22f };
321 return ((x.a & 0x03ff) == (y.a & 0x3ff0) &&
322 (x.b & 0x03ff) == (y.b & 0x3ff0));
326 h7()
328 static struct hx x = { 0xc11f, 0xc22f, ~1 };
329 static struct hy y = { ~2, 0xfd10, 0xfe20 };
331 return ((x.a & 0x3ff0) == (y.a & 0x03ff) &&
332 (x.b & 0x3ff0) == (y.b & 0x03ff));
336 main()
338 if (!a1 ())
339 abort ();
340 if (!a2 ())
341 abort ();
342 if (!a3 ())
343 abort ();
344 if (!b1 ())
345 abort ();
346 if (!b2 ())
347 abort ();
348 if (!b3 ())
349 abort ();
350 if (!c1 ())
351 abort ();
352 if (!c2 ())
353 abort ();
354 if (!c3 ())
355 abort ();
356 if (!d1 ())
357 abort ();
358 if (!d2 ())
359 abort ();
360 if (!d3 ())
361 abort ();
362 if (!e1 ())
363 abort ();
364 if (!e2 ())
365 abort ();
366 if (!e3 ())
367 abort ();
368 if (!e4 ())
369 abort ();
370 if (!f1 ())
371 abort ();
372 if (!f2 ())
373 abort ();
374 if (!f3 ())
375 abort ();
376 if (!f4 ())
377 abort ();
378 if (!g1 ())
379 abort ();
380 if (!g2 ())
381 abort ();
382 if (!g3 ())
383 abort ();
384 if (g4 ())
385 abort ();
386 if (g5 ())
387 abort ();
388 if (!g6 ())
389 abort ();
390 if (!g7 ())
391 abort ();
392 if (!h1 ())
393 abort ();
394 if (!h2 ())
395 abort ();
396 if (!h3 ())
397 abort ();
398 if (h4 ())
399 abort ();
400 if (h5 ())
401 abort ();
402 if (!h6 ())
403 abort ();
404 if (!h7 ())
405 abort ();
406 exit (0);