| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -fno-early-inlining -fipa-pta" } */ |
| 3 |
|
| 4 |
static void __attribute__((noinline,noclone)) |
| 5 |
clobber_me (int *p, int how) |
| 6 |
{ |
| 7 |
*p = how; |
| 8 |
} |
| 9 |
|
| 10 |
/* When foo is inlined into main we have to make sure to adjust |
| 11 |
main()s IPA CLOBBERED set according to the decl remappings |
| 12 |
inlining does. */ |
| 13 |
|
| 14 |
static int |
| 15 |
foo (void) |
| 16 |
{ |
| 17 |
int a = 0; |
| 18 |
clobber_me (&a, 1); |
| 19 |
return a; |
| 20 |
} |
| 21 |
|
| 22 |
extern void abort (void); |
| 23 |
|
| 24 |
int main() |
| 25 |
{ |
| 26 |
if (foo () != 1) |
| 27 |
abort (); |
| 28 |
|
| 29 |
return 0; |
| 30 |
} |