Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / g++.dg / stackprotectexplicit2.C
blob9cf9ab909c98f8a86655a3ad2322928d711a5402
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" } */
6 int A()
8         int A[23];
9         char b[22];
12 int __attribute__((stack_protect)) B()
14         int a;
15         int b;
16         return a+b;
19 int __attribute__((stack_protect)) c()
21         int a;
22         char b[34];
23         return 0;
27 /* { dg-final { scan-assembler-times "stack_chk_fail" 2 } } */