summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr46909-2.c
blob: 33da2189c447a78e91235aa3d18021beefc0a3ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR tree-optimization/46909 */

extern void abort (void);

int
__attribute__((noinline))
foo (int x)
{
  if ((x != 0 && x != 13) || x == 5 || x == 20)
    return 1;
  return -1;
}

int
main (void)
{
  int i;
  for (i = -10; i < 30; i++)
    if (foo (i) != 1 - 2 * (i == 0) - 2 * (i == 13))
      abort ();
  return 0;
}