gcc/testsuite/gcc.c-torture/execute/pr115277.c
raw| 1 | int array[1000]; |
| 2 | void |
| 3 | test (int a) |
| 4 | { |
| 5 | if (__builtin_expect (a > 3, 1)) |
| 6 | return; |
| 7 | for (int i = 0; i < a; i++) |
| 8 | array[i]=i; |
| 9 | } |
| 10 | void |
| 11 | test2 (int a) |
| 12 | { |
| 13 | if (__builtin_expect (a > 10, 1)) |
| 14 | return; |
| 15 | for (int i = 0; i < a; i++) |
| 16 | array[i]=i; |
| 17 | } |
| 18 | int |
| 19 | main() |
| 20 | { |
| 21 | test(1); |
| 22 | test(2); |
| 23 | test(3); |
| 24 | test2(10); |
| 25 | if (array[9] != 9) |
| 26 | __builtin_abort (); |
| 27 | return 0; |
| 28 | } |