[PR64164] Drop copyrename, use coalescible partition as base when optimizing.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr37868.c
blob5204c5a5941cdd407189a811f9cf8740bdfaf2b4
1 /* { dg-do run } */
2 /* { dg-options "-fno-strict-aliasing" } */
3 /* { dg-skip-if "unaligned access" { arc*-*-* epiphany-*-* nds32*-*-* sparc*-*-* sh*-*-* tic6x-*-* } "*" "" } */
5 extern void abort (void);
6 #if (__SIZEOF_INT__ <= 2)
7 struct X {
8 unsigned char pad : 4;
9 unsigned int a : 16;
10 unsigned int b : 8;
11 unsigned int c : 6;
12 } __attribute__((packed));
13 #else
14 struct X {
15 unsigned char pad : 4;
16 unsigned int a : 32;
17 unsigned int b : 24;
18 unsigned int c : 6;
19 } __attribute__((packed));
21 #endif
24 int main (void)
26 struct X x;
27 unsigned int bad_bits;
29 x.pad = -1;
30 x.a = -1;
31 x.b = -1;
32 x.c = -1;
34 bad_bits = ((unsigned int)-1) ^ *(1+(unsigned int *) &x);
35 if (bad_bits != 0)
36 abort ();
37 return 0;