summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr67769.c
blob: c1d17c3f3db89f0078f84a11012d6e2ed641fab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do run } */

static int
clamp (int x, int lo, int hi)
{
  return (x < lo) ? lo : ((x > hi) ? hi : x);
}

__attribute__ ((noinline))
short
foo (int N)
{
  short value = clamp (N, 0, 16);
  return value;
}

int
main ()
{
  if (foo (-5) != 0)
    __builtin_abort ();
  return 0;
}