gcc/testsuite/gcc.c-torture/execute/20230509-1.c
raw| 1 | int __attribute__((noipa)) f(unsigned a, int b) |
| 2 | { |
| 3 | if (a < 0) __builtin_unreachable(); |
| 4 | if (a > 30) __builtin_unreachable(); |
| 5 | int t = a; |
| 6 | if (b) t = 100; |
| 7 | else if (a != 0) |
| 8 | t = a ; |
| 9 | else |
| 10 | t = 1; |
| 11 | return t; |
| 12 | } |
| 13 | |
| 14 | |
| 15 | int main(void) |
| 16 | { |
| 17 | if (f(0, 0) != 1) |
| 18 | __builtin_abort(); |
| 19 | if (f(1, 0) != 1) |
| 20 | __builtin_abort(); |
| 21 | if (f(0, 1) != 100) |
| 22 | __builtin_abort(); |
| 23 | if (f(1, 0) != 1) |
| 24 | __builtin_abort(); |
| 25 | if (f(30, 0) != 30) |
| 26 | __builtin_abort(); |
| 27 | } |
| 28 |