c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / c-c++-common / strub-strict2.c
blob3bf1aa30b4af1081b365208132b1ad82c201389f
1 /* { dg-do compile } */
2 /* { dg-options "-fstrub=strict -fdump-ipa-strubm" } */
3 /* { dg-require-effective-target strub } */
5 static int __attribute__ ((__strub__)) var;
7 /* g becomes STRUB_INTERNAL because of the use of the strub variable, and gets
8 split into STRUB_WRAPPER and STRUB_WRAPPED. It's not STRUB_AT_CALLS_OPT
9 because force_output is set for static non-inline functions when not
10 optimizing, and that keeps only_called_directly_p from returning true, which
11 makes STRUB_AT_CALLS[_OPT] non-viable. */
12 static void
13 g() {
14 var--;
17 /* f becomes STRUB_INTERNAL because of the use of the strub variable, and gets
18 split into STRUB_WRAPPER and STRUB_WRAPPED. */
19 void
20 f() {
21 var++;
22 g(); /* { dg-error "calling non-.strub." } */
25 /* { dg-final { scan-ipa-dump-times "strub \[(\]" 2 "strubm" } } */
26 /* { dg-final { scan-ipa-dump-times "strub \[(\]internal\[)\]" 2 "strubm" } } */