111
|
1 /* Test that stack protection is done on chosen functions. */
|
|
2
|
|
3 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
|
|
4 /* { dg-options "-O2 -fstack-protector-explicit" } */
|
|
5
|
|
6 int A()
|
|
7 {
|
|
8 int A[23];
|
|
9 char b[22];
|
131
|
10 return 0;
|
111
|
11 }
|
|
12
|
|
13 int __attribute__((stack_protect)) B()
|
|
14 {
|
|
15 int a;
|
|
16 int b;
|
|
17 return a+b;
|
|
18 }
|
|
19
|
|
20 int __attribute__((stack_protect)) c()
|
|
21 {
|
|
22 int a;
|
|
23 char b[34];
|
|
24 return 0;
|
|
25 }
|
|
26
|
|
27
|
131
|
28 /* { dg-final { scan-assembler-times "stack_chk_fail" 2 } } */
|