aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr97953.c
blob: 6219619d67b07a8777068ad86e27426c76f279d6 (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
/* { dg-do run } */
/* { dg-options "-O2 -fno-tree-fre" } */

int __attribute__((noipa))
foo (int flag, int *p)
{
  int val = *p;
  if (flag)
    {
      if (val != 1)
        __builtin_unreachable ();
      return 0;
    }
  int val2 = *p;
  return val2 == 2;
}

int main()
{
  int i = 2;
  if (foo (0, &i) != 1)
    __builtin_abort ();
  return 0;
}