[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / stack-check-7.c
blobb963a2881dcf4f60750bb077651fcb9dc8d4c825
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fstack-clash-protection -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
3 /* { dg-require-effective-target supports_stack_clash_protection } */
5 /* For further testing, this can be run under valgrind where it's crashed
6 on aarch64 and ppc64le with -fstack-check=specific. */
9 __attribute__((noinline, noclone)) void
10 foo (char *p)
12 asm volatile ("" : : "r" (p) : "memory");
15 __attribute__((noinline, noclone)) void
16 bar (void)
18 char buf[131072];
19 foo (buf);
22 __attribute__((noinline, noclone)) void
23 baz (void)
25 char buf[12000];
26 foo (buf);
29 int
30 main ()
32 bar ();
33 baz ();
34 return 0;