aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr114902.c
blob: 60684faa25d5d91224c87923c63699ed28d1680c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* PR rtl-optimization/114902 */
/* { dg-do run } */
/* { dg-options "-O1 -fno-tree-fre -fno-tree-forwprop -fno-tree-ccp -fno-tree-dominator-opts" } */

__attribute__((noipa))
int foo (int x)
{
  int a = ~x;
  int t = a & 1;
  int e = -t;
  int b = e >= -1;
  if (b)
    return 0;
  __builtin_trap ();
}

int
main ()
{
  foo (-1);
  foo (0);
  foo (1);
}