Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/stackprotectexplicit2.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
rev | line source |
---|---|
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]; | |
10 } | |
11 | |
12 int __attribute__((stack_protect)) B() | |
13 { | |
14 int a; | |
15 int b; | |
16 return a+b; | |
17 } | |
18 | |
19 int __attribute__((stack_protect)) c() | |
20 { | |
21 int a; | |
22 char b[34]; | |
23 return 0; | |
24 } | |
25 | |
26 | |
27 /* { dg-final { scan-assembler-times "stack_chk_fail" 2 } } */ |