gcc/testsuite/gcc.c-torture/execute/pr46309.c
raw| 1 | /* PR tree-optimization/46309 */ |
| 2 | |
| 3 | extern void abort (void); |
| 4 | |
| 5 | unsigned int *q; |
| 6 | |
| 7 | __attribute__((noinline, noclone)) void |
| 8 | bar (unsigned int *p) |
| 9 | { |
| 10 | if (*p != 2 && *p != 3) |
| 11 | (!(!(*q & 263) || *p != 1)) ? abort () : 0; |
| 12 | } |
| 13 | |
| 14 | int |
| 15 | main () |
| 16 | { |
| 17 | unsigned int x, y; |
| 18 | asm volatile ("" : : : "memory"); |
| 19 | x = 2; |
| 20 | bar (&x); |
| 21 | x = 3; |
| 22 | bar (&x); |
| 23 | y = 1; |
| 24 | x = 0; |
| 25 | q = &y; |
| 26 | bar (&x); |
| 27 | y = 0; |
| 28 | x = 1; |
| 29 | bar (&x); |
| 30 | return 0; |
| 31 | } |