summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr49039.c
blob: 546d114fedcb2d54c3843745eb15496c8e70addc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* PR tree-optimization/49039 */
extern void abort (void);
int cnt;

__attribute__((noinline, noclone)) void
foo (unsigned int x, unsigned int y)
{
  unsigned int minv, maxv;
  if (x == 1 || y == -2U)
    return;
  minv = x < y ? x : y;
  maxv = x > y ? x : y;
  if (minv == 1)
    ++cnt;
  if (maxv == -2U)
    ++cnt;
}

int
main ()
{
  foo (-2U, 1);
  if (cnt != 2)
    abort ();
  return 0;
}