C99 testsuite readiness: Compile more tests with -std=gnu89
[official-gcc.git] / gcc / testsuite / g++.dg / stackprotectexplicit2.C
blob70d8df4c73de2447d9ac29d7d37121fb2fdf6dbe
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-explicit" } */
5 /* { dg-additional-options "-fno-PIE" { target ia32 } } */
7 int A()
9         int A[23];
10         char b[22];
11         return 0;
14 int __attribute__((stack_protect)) B()
16         int a;
17         int b;
18         return a+b;
21 int __attribute__((stack_protect)) c()
23         int a;
24         char b[34];
25         return 0;
29 /* { dg-final { scan-assembler-times "stack_chk_fail" 2 } } */