gcc/testsuite/gcc.c-torture/execute/20030828-1.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | const int *p; |
| 5 | |
| 6 | int bar (void) |
| 7 | { |
| 8 | return *p + 1; |
| 9 | } |
| 10 | |
| 11 | int |
| 12 | main (void) |
| 13 | { |
| 14 | /* Variable 'i' is never used but it's aliased to a global pointer. The |
| 15 | alias analyzer was not considering that 'i' may be used in the call to |
| 16 | bar(). */ |
| 17 | const int i = 5; |
| 18 | p = &i; |
| 19 | if (bar() != 6) |
| 20 | abort (); |
| 21 | exit (0); |
| 22 | } |