gcc/testsuite/gcc.c-torture/execute/pr53465.c
raw| 1 | /* PR tree-optimization/53465 */ |
| 2 | |
| 3 | extern void abort (); |
| 4 | |
| 5 | static const int a[] = { 1, 2 }; |
| 6 | |
| 7 | void |
| 8 | foo (const int *x, int y) |
| 9 | { |
| 10 | int i; |
| 11 | int b = 0; |
| 12 | int c; |
| 13 | for (i = 0; i < y; i++) |
| 14 | { |
| 15 | int d = x[i]; |
| 16 | if (d == 0) |
| 17 | break; |
| 18 | if (b && d <= c) |
| 19 | abort (); |
| 20 | c = d; |
| 21 | b = 1; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | int |
| 26 | main () |
| 27 | { |
| 28 | foo (a, 2); |
| 29 | return 0; |
| 30 | } |