freebsd-dev/test/CodeGen/stack-protector.c

15 lines
582 B
C
Raw Normal View History

2010-01-01 10:34:51 +00:00
// RUN: %clang_cc1 -emit-llvm -o - %s -stack-protector 0 | FileCheck -check-prefix=NOSSP %s
2009-11-18 14:59:57 +00:00
// NOSSP: define void @test1(i8* %msg) nounwind {
2010-01-01 10:34:51 +00:00
// RUN: %clang_cc1 -emit-llvm -o - %s -stack-protector 1 | FileCheck -check-prefix=WITHSSP %s
2009-11-18 14:59:57 +00:00
// WITHSSP: define void @test1(i8* %msg) nounwind ssp {
2010-01-01 10:34:51 +00:00
// RUN: %clang_cc1 -emit-llvm -o - %s -stack-protector 2 | FileCheck -check-prefix=SSPREQ %s
2009-11-18 14:59:57 +00:00
// SSPREQ: define void @test1(i8* %msg) nounwind sspreq {
2009-07-04 13:58:54 +00:00
2009-10-14 18:03:49 +00:00
int printf(const char * _Format, ...);
2009-07-04 13:58:54 +00:00
void test1(const char *msg) {
char a[strlen(msg) + 1];
strcpy(a, msg);
printf("%s\n", a);
}