2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -o - %s -stack-protector 0 | FileCheck -check-prefix=NOSSP %s
|
2013-02-17 11:06:16 +08:00
|
|
|
// NOSSP: define void @test1(i8* %msg) nounwind {{.*}}{
|
2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -o - %s -stack-protector 1 | FileCheck -check-prefix=WITHSSP %s
|
2013-02-17 11:06:16 +08:00
|
|
|
// WITHSSP: define void @test1(i8* %msg) nounwind ssp {{.*}}{
|
2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -o - %s -stack-protector 2 | FileCheck -check-prefix=SSPREQ %s
|
2013-02-17 11:06:16 +08:00
|
|
|
// SSPREQ: define void @test1(i8* %msg) nounwind sspreq {{.*}}{
|
|
|
|
|
|
|
|
typedef __SIZE_TYPE__ size_t;
|
2009-06-28 15:36:13 +08:00
|
|
|
|
2009-10-09 07:05:06 +08:00
|
|
|
int printf(const char * _Format, ...);
|
2013-02-17 11:06:16 +08:00
|
|
|
size_t strlen(const char *s);
|
|
|
|
char *strcpy(char *s1, const char *s2);
|
2009-06-28 15:36:13 +08:00
|
|
|
|
|
|
|
void test1(const char *msg) {
|
|
|
|
char a[strlen(msg) + 1];
|
|
|
|
strcpy(a, msg);
|
|
|
|
printf("%s\n", a);
|
|
|
|
}
|