| 1 |
/* PR debug/49888 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-g" } */ |
| 4 |
|
| 5 |
static int v __attribute__((used)); |
| 6 |
|
| 7 |
static void __attribute__((noipa)) |
| 8 |
f (int *p) |
| 9 |
{ |
| 10 |
int c = *p; |
| 11 |
v = c; |
| 12 |
*p = 1; /* { dg-final { gdb-test . "!!c" "0" } } */ |
| 13 |
/* c may very well be optimized out at this point, so we test !c, |
| 14 |
which will evaluate to the expected value. We just want to make |
| 15 |
sure it doesn't remain bound to *p as it did before, in which |
| 16 |
case !c would evaluate to 0. *p may also be regarded as aliasing |
| 17 |
register saves, thus the !!c above. */ |
| 18 |
v = 0; /* { dg-final { gdb-test . "!c" "1" } } */ |
| 19 |
} |
| 20 |
int |
| 21 |
main () |
| 22 |
{ |
| 23 |
int a = 0; |
| 24 |
f (&a); |
| 25 |
return 0; |
| 26 |
} |