[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / ssp-2.c
blob752fe5393f4c66a57bc8b8dc8bc623fe2c1893ab
1 /* { dg-do run { target native } } */
2 /* { dg-options "-fstack-protector" } */
3 /* { dg-options "-fstack-protector -Wl,-multiply_defined,suppress" { target *-*-darwin* } } */
4 /* { dg-require-effective-target fstack_protector } */
6 #include <stdlib.h>
8 void
9 __stack_chk_fail (void)
11 exit (0); /* pass */
14 void
15 overflow()
17 register int i = 0;
18 char foo[30];
20 /* Overflow buffer. */
21 for (i = 0; i < 50; i++)
22 foo[i] = 42;
25 int main (void)
27 overflow ();
28 return 1; /* fail */