summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-pta-8.c
blob: 5bedc9d8a6550df8f772982c012a0ba5351f120b (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
31
/* { dg-do run } */
/* { dg-options "-O2 -fno-early-inlining -fipa-pta" } */

static int *__attribute__((noinline,noclone))
pass_me (int *p)
{
  return p;
}

/* 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;
  int *p = pass_me (&a);
  *p = 1;
  return a;
}

extern void abort (void);

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

  return 0;
}