aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr106032.c
blob: d2ccf6a5b5222e5a17a8dfccefa4ade5dbf5d244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR rtl-optimization/106032 */

__attribute__((noipa)) int
foo (int x, int *y)
{
  int a = 0;
  if (x < 0)
    a = *y;
  return a;  
}

int
main ()
{
  int a = 42;
  if (foo (0, 0) != 0 || foo (1, 0) != 0)
    __builtin_abort ();
  if (foo (-1, &a) != 42 || foo (-42, &a) != 42)
    __builtin_abort ();
  return 0;
}