summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr42084.c
blob: d5aad9642cc00a9099859f891f6c04cb94e4f26b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do run } */
/* { dg-options "-O1 -fno-delete-null-pointer-checks" } */
extern void abort (void);
int g = 0;
static int __attribute__((noinline)) f (long long a, long long b)
{
  int cmp;
  cmp = a > b;
  if (&g == 0)
    cmp-=2;
  else
    cmp++;
  return cmp;
}

int main (void)
{
  int ret = f (2, 1);
  if (ret != 2)
    abort ();
  return 0;
}