aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/strub-O2.c
blob: 37e02998e318e377d9d4f53072ccc937fc36106e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-O2 -fstrub=strict -fdump-rtl-expand" } */
/* { dg-require-effective-target strub } */

/* At -O2, without -fno-inline, we fully expand enter and update, and add a test
   around the leave call.  */

int __attribute__ ((__strub__)) var;

int f() {
  return var;
}

/* { dg-final { scan-rtl-dump-not "strub_enter" "expand" } } */
/* { dg-final { scan-rtl-dump-not "strub_update" "expand" } } */
/* { dg-final { scan-rtl-dump "strub_leave" "expand" } } */
/* { dg-final { scan-rtl-dump "\[(\]call\[^\n\]*strub_leave.*\n\[(\]code_label" "expand" } } */