opnsense-src/test/CodeGen/stack-protector.c

22 lines
702 B
C
Raw Normal View History

2009-07-04 09:58:54 -04:00
// RUN: clang-cc -triple i686-unknown-unknown -emit-llvm -o %t %s &&
// RUN: not grep 'ssp' %t &&
// RUN: clang-cc -triple i686-apple-darwin9 -emit-llvm -o %t %s &&
// RUN: not grep 'ssp' %t &&
// RUN: clang-cc -triple i686-apple-darwin10 -emit-llvm -o %t %s &&
// RUN: grep 'ssp' %t &&
// RUN: clang -fstack-protector-all -emit-llvm -S -o %t %s &&
// RUN: grep 'sspreq' %t &&
// RUN: clang -fstack-protector -emit-llvm -S -o %t %s &&
// RUN: grep 'ssp' %t &&
// RUN: clang -fno-stack-protector -emit-llvm -S -o %t %s &&
// RUN: not grep 'ssp' %t &&
// RUN: true
2009-10-14 14:03:49 -04:00
int printf(const char * _Format, ...);
2009-07-04 09:58:54 -04:00
void test1(const char *msg) {
char a[strlen(msg) + 1];
strcpy(a, msg);
printf("%s\n", a);
}