gcc/testsuite/gcc.c-torture/execute/981130-1.c
raw| 1 | /* { dg-xfail-if "alias analysis conflicts with instruction scheduling" { m32r-*-* } { "-O2" "-O1" "-O0" "-Os"} { "" } } */ |
| 2 | void abort (void); |
| 3 | void exit (int); |
| 4 | struct s { int a; int b;}; |
| 5 | struct s s1; |
| 6 | struct s s2 = { 1, 2, }; |
| 7 | |
| 8 | void |
| 9 | check (a, b) |
| 10 | int a; |
| 11 | int b; |
| 12 | { |
| 13 | if (a == b) |
| 14 | exit (0); |
| 15 | else |
| 16 | abort (); |
| 17 | } |
| 18 | |
| 19 | int |
| 20 | main () |
| 21 | { |
| 22 | int * p; |
| 23 | int x; |
| 24 | |
| 25 | s1.a = 9; |
| 26 | p = & s1.a; |
| 27 | s1 = s2; |
| 28 | x = * p; |
| 29 | |
| 30 | check (x, 1); |
| 31 | } |
| 32 | |
| 33 |