1/* { dg-do compile } */ 2/* { dg-options "-O2 -fstack-protector" } */ 3/* { dg-require-effective-target fstack_protector } */ 4/* There should be 2 references to __stack_chk_guard in every function. */ 5/* { dg-final { scan-assembler-times "__stack_chk_guard" 4 } } */ 6 7#include <stdlib.h> 8#include <string.h> 9void doTest1(void) { 10 volatile char foo[10]; 11 memset((void *)foo, 1, 100); 12} 13void doTest2(void) { 14 volatile char foo[10]; 15 memset((void *)foo, 1, 100); 16} 17