strub: enable conditional support
[official-gcc.git] / gcc / testsuite / c-c++-common / torture / strub-const2.c
bloba105c66d7a9c9b1d9925c042e9c9784f83068bdd
1 /* { dg-do compile } */
2 /* { dg-options "-fstrub=strict -fdump-ipa-strub" } */
3 /* { dg-require-effective-target strub } */
5 /* Check that, along with a strub implicitly-const function call, we issue an
6 asm statement to make sure the watermark passed to it is held in memory
7 before the call, and another to make sure it is not assumed to be
8 unchanged. */
10 extern int __attribute__ ((__strub__ ("callable"),
11 __const__, __nothrow__)) c ();
13 int __attribute__ ((__strub__))
14 #if ! __OPTIMIZE__
15 __attribute__ ((__const__))
16 #endif
17 f () {
18 return c ();
21 int
22 g () {
23 return f ();
26 /* { dg-final { scan-ipa-dump-times "__asm__" 2 "strub" } } */