summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp12.c
blob: 1714a561cd5cf35967ec9d53db4230d8c54c8713 (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 link } */
/* { dg-options -O2 } */

foo (int i)
{
  int x;

  x = i;
  if (i < -10)
    {
      x = __builtin_abs (i);
      /* VRP was incorrectly folding this to if (1).  */
      if (x < 0)
	link_error ();
    }

  return x;
}

main()
{
  foo (-30);
}