| 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 pure function call, we issue an asm statement |
| 6 |
to make sure the watermark passed to it is not assumed to be unchanged. */ |
| 7 |
|
| 8 |
int __attribute__ ((__strub__, __pure__)) |
| 9 |
f() { |
| 10 |
static int i; /* Stop it from being detected as const. */ |
| 11 |
return i; |
| 12 |
} |
| 13 |
|
| 14 |
int |
| 15 |
g() { |
| 16 |
return f(); |
| 17 |
} |
| 18 |
|
| 19 |
/* { dg-final { scan-ipa-dump-times "__asm__" 1 "strub" } } */ |