PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / stackprotectexplicit1.c
blob658c297d9f58e74f56309a6f97fa623700d04817
1 /* { dg-do run { target native } } */
2 /* { dg-options "-fstack-protector-explicit" } */
3 /* { dg-require-effective-target fstack_protector } */
5 #include <stdlib.h>
7 void
8 __stack_chk_fail (void)
10 exit (0); /* pass */
13 int __attribute__((stack_protect)) main ()
15 int i;
16 char foo[255];
18 // smash stack
19 for (i = 0; i <= 400; i++)
20 foo[i] = 42;
22 return 1; /* fail */