blob: c29d1f7f33d9e1b99b6d13519364c55498768494 [file] [log] [blame]
Daniel Dunbar9e5cc6b2009-11-17 08:07:36 +00001// RUN: clang-cc -emit-llvm -o - %s -stack-protector=0 | FileCheck -check-prefix=NOSSP %s
2// NOSSP: define void @test1(i8* %msg) nounwind {
3// RUN: clang-cc -emit-llvm -o - %s -stack-protector=1 | FileCheck -check-prefix=WITHSSP %s
4// WITHSSP: define void @test1(i8* %msg) nounwind ssp {
5// RUN: clang-cc -emit-llvm -o - %s -stack-protector=2 | FileCheck -check-prefix=SSPREQ %s
6// SSPREQ: define void @test1(i8* %msg) nounwind sspreq {
Bill Wendling45483f72009-06-28 07:36:13 +00007
Mike Stump76bee4b2009-10-08 23:05:06 +00008int printf(const char * _Format, ...);
Bill Wendling45483f72009-06-28 07:36:13 +00009
10void test1(const char *msg) {
11 char a[strlen(msg) + 1];
12 strcpy(a, msg);
13 printf("%s\n", a);
14}