2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / gcc.dg / ssp-2.c
blob9a7ac3206fd8e5a0799c340cbd3aa68aed25dc2a
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 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 */