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 6int A() 7{ 8 int A[23]; 9 char b[22]; 10} 11 12int __attribute__((stack_protect)) B() 13{ 14 int a; 15 int b; 16 return a+b; 17} 18 19int __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 } } */