| 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 const function call, we issue an asm |
| 6 |
statement to make sure the watermark passed to it is held in memory before |
| 7 |
the call, and another to make sure it is not assumed to be unchanged. f |
| 8 |
should not be inlined into g, but if it were too simple it might be folded |
| 9 |
by interprocedural value-range propagation. */ |
| 10 |
|
| 11 |
extern int __attribute__ ((__strub__ ("callable"), |
| 12 |
__const__, __nothrow__)) c (); |
| 13 |
|
| 14 |
int __attribute__ ((__strub__, __const__)) |
| 15 |
f () { |
| 16 |
return c (); |
| 17 |
} |
| 18 |
|
| 19 |
int |
| 20 |
g () { |
| 21 |
return f (); |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-final { scan-ipa-dump-times "__asm__" 2 "strub" } } */ |