1 /* Test that stack protection is done on chosen functions. */
3 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
4 /* { dg-options "-O2 -fstack-protector-strong" } */
15 /* Frame address exposed to A::method via "this". */
24 /* Possible destroying foo2's stack via &a. */
28 /* Frame address exposed to global_func. */
32 return global_func (a);
35 /* Frame addressed exposed through return slot. */
39 /* Discourage passing this struct in registers. */
40 int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
50 return global_func ().a1;
59 return global_func ().a1;
66 return global_func ().a1;
80 return p->return_slot ().a1;
83 /* { dg-final { scan-assembler-times "stack_chk_fail" 7 } } */