gcc/testsuite/gcc.dg/torture/pr93946-1.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | union U { long long i; long f; }; |
| 4 | struct a {union U u;}; |
| 5 | struct aa {struct a a;}; |
| 6 | struct b {union U u;}; |
| 7 | struct bb {struct b b;}; |
| 8 | |
| 9 | long __attribute__((noipa)) |
| 10 | foo (struct bb *bv, void *ptr) |
| 11 | { |
| 12 | struct aa *a = ptr; |
| 13 | struct bb *b = ptr; |
| 14 | bv->b.u.f = 1; |
| 15 | a->a.u.i = 0; |
| 16 | b->b.u.f = 0; |
| 17 | return bv->b.u.f; |
| 18 | } |
| 19 | |
| 20 | int |
| 21 | main () |
| 22 | { |
| 23 | union C {struct aa aa; struct bb bb;} v; |
| 24 | if (foo (&v.bb, &v) != 0) |
| 25 | __builtin_abort (); |
| 26 | return 0; |
| 27 | } |