gcc/testsuite/gcc.dg/torture/pr67769.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | static int |
| 4 | clamp (int x, int lo, int hi) |
| 5 | { |
| 6 | return (x < lo) ? lo : ((x > hi) ? hi : x); |
| 7 | } |
| 8 | |
| 9 | __attribute__ ((noinline)) |
| 10 | short |
| 11 | foo (int N) |
| 12 | { |
| 13 | short value = clamp (N, 0, 16); |
| 14 | return value; |
| 15 | } |
| 16 | |
| 17 | int |
| 18 | main () |
| 19 | { |
| 20 | if (foo (-5) != 0) |
| 21 | __builtin_abort (); |
| 22 | return 0; |
| 23 | } |