Debian Codegraph @

gcc/testsuite/c-c++-common/torture/strub-const2.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 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. */
9
10 extern int __attribute__ ((__strub__ ("callable"),
11 __const__, __nothrow__)) c ();
12
13 int __attribute__ ((__strub__))
14 #if ! __OPTIMIZE__
15 __attribute__ ((__const__))
16 #endif
17 f () {
18 return c ();
19 }
20
21 int
22 g () {
23 return f ();
24 }
25
26 /* { dg-final { scan-ipa-dump-times "__asm__" 2 "strub" } } */