gcc/testsuite/gcc.dg/ipa/pr103083-1.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O2 -Wno-pointer-to-int-cast" } */ |
| 3 | |
| 4 | struct b {int b;}; |
| 5 | struct a {int a; struct b b;}; |
| 6 | |
| 7 | long i; |
| 8 | |
| 9 | __attribute__ ((noinline)) |
| 10 | static void test2 (struct b *b) |
| 11 | { |
| 12 | if (((int)b)&4) |
| 13 | __builtin_abort (); |
| 14 | } |
| 15 | |
| 16 | __attribute__ ((noinline)) |
| 17 | static void |
| 18 | test (struct a *a) |
| 19 | { |
| 20 | test2(a? &a->b : 0); |
| 21 | } |
| 22 | |
| 23 | int |
| 24 | main() |
| 25 | { |
| 26 | test(0); |
| 27 | return 0; |
| 28 | } |