Debian Codegraph @

gcc/testsuite/c-c++-common/torture/strub-const4.c

raw
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-const wrapping 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. */
9
10 extern int __attribute__ ((__strub__ ("callable"),
11 __const__, __nothrow__)) c ();
12
13 int __attribute__ ((__strub__ ("internal")))
14 #if ! __OPTIMIZE__
15 __attribute__ ((__const__))
16 #endif
17 f () {
18 return c ();
19 }
20
21 /* { dg-final { scan-ipa-dump-times "__asm__" 2 "strub" } } */