summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/ssp-strong-reg.c
blob: db39c1f0a706cbe4e9477fa8f2aa666495a05c3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Test that structs returned in registers do not lead to
   instrumentation with -fstack-protector-strong.  */

/* { dg-do compile { target { ! ia32 } } } */
/* { dg-options "-O2 -fstack-protector-strong" } */

struct S {
  int a;
  int b;
};

struct S f (void);

int g (void)
{
  return f ().a;
}

/* { dg-final { scan-assembler-times "stack_chk_fail" 0 } } */