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" } */
6 /* This test checks the presence of __stack_chk_fail function in assembler.
7 * Compiler generates _stack_chk_fail_local (wrapper) calls instead for PIC.
9 /* { dg-require-effective-target nonpic } */
20 /* Frame address exposed to A::method via "this". */
29 /* Possible destroying foo2's stack via &a. */
33 /* Frame address exposed to global_func. */
37 return global_func (a);
40 /* Frame addressed exposed through return slot. */
44 /* Discourage passing this struct in registers. */
45 int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
55 return global_func ().a1;
64 return global_func ().a1;
71 return global_func ().a1;
85 return p->return_slot ().a1;
88 /* { dg-final { scan-assembler-times "stack_chk_fail" 7 } } */