strub: enable conditional support
[official-gcc.git] / gcc / testsuite / c-c++-common / torture / strub-const1.c
blob22056713cce4bdb7f8eb3507bbcb96a547039878
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 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. */
11 extern int __attribute__ ((__strub__ ("callable"),
12 __const__, __nothrow__)) c ();
14 int __attribute__ ((__strub__, __const__))
15 f () {
16 return c ();
19 int
20 g () {
21 return f ();
24 /* { dg-final { scan-ipa-dump-times "__asm__" 2 "strub" } } */