| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fstrub=strict -fdump-ipa-strub" } */ |
| 3 |
/* { dg-require-effective-target strub } */ |
| 4 |
|
| 5 |
/* Check that, along with a strub implicitly-pure wrapping call, we issue an asm |
| 6 |
statement to make sure the watermark passed to it is not assumed to be |
| 7 |
unchanged. */ |
| 8 |
|
| 9 |
int __attribute__ ((__strub__ ("internal"))) |
| 10 |
#if ! __OPTIMIZE__ /* At -O0, implicit pure detection doesn't run. */ |
| 11 |
__attribute__ ((__pure__)) |
| 12 |
#endif |
| 13 |
f() { |
| 14 |
static int i; /* Stop it from being detected as const. */ |
| 15 |
return i; |
| 16 |
} |
| 17 |
|
| 18 |
/* { dg-final { scan-ipa-dump-times "__asm__" 1 "strub" } } */ |