More fold_negate in match.pd
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr69355.c
blobf515c211c99bdfa2865a05b30186957559fbfc39
1 /* { dg-do run } */
2 /* { dg-options "-O -fno-strict-aliasing" } */
4 struct S
6 void *a;
7 long double b;
8 };
10 struct Z
12 long long l;
13 short s;
14 } __attribute__((packed));
16 struct S __attribute__((noclone, noinline))
17 foo (void *v, struct Z *z)
19 struct S t;
20 t.a = v;
21 *(struct Z *) &t.b = *z;
22 return t;
25 struct Z gz;
27 int
28 main (int argc, char **argv)
30 struct S s;
32 if (sizeof (long double) < sizeof (struct Z))
33 return 0;
35 gz.l = 0xbeef;
36 gz.s = 0xab;
38 s = foo ((void *) 0, &gz);
40 if ((((struct Z *) &s.b)->l != gz.l)
41 || (((struct Z *) &s.b)->s != gz.s))
42 __builtin_abort ();
43 return 0;