summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-pta-7.c
blob: 3cdfd63fa3e305e25185171f8ec153f97a5e7c99 (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
25
26
27
28
29
30
/* { dg-do run } */
/* { dg-options "-O2 -fno-early-inlining -fipa-pta" } */

static void __attribute__((noinline,noclone))
clobber_me (int *p, int how)
{
  *p = how;
}

/* When foo is inlined into main we have to make sure to adjust
   main()s IPA CLOBBERED set according to the decl remappings
   inlining does.  */

static int
foo (void)
{
  int a = 0;
  clobber_me (&a, 1);
  return a;
}

extern void abort (void);

int main()
{
  if (foo () != 1)
    abort ();

  return 0;
}