2018-11-28 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr84877.c
blob8a34dd4fb66de169d469c17b458c3745577bef06
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 #include <inttypes.h>
6 struct U {
7 int M0;
8 int M1;
9 } __attribute ((aligned (16)));
11 volatile struct U p0 = {1, 0};
13 void __attribute__ ((noinline))
14 foo (struct U p)
17 volatile intptr_t mask = 0b1111;
18 volatile int dummy[2];
19 struct U p1 = p;
20 dummy[1] = p.M0;
22 if ((intptr_t)(&p1) & mask)
23 __builtin_abort ();
24 if ((intptr_t)(&p) & mask)
25 __builtin_abort ();
27 if (p1.M0 != dummy[1])
28 __builtin_abort ();
29 if (p1.M1 != p.M1)
30 __builtin_abort ();
33 int
34 main ()
36 foo (p0);
37 return 0;