blob: 57635976d05f716cefafc7457fc1360de1c9b65c [file] [log] [blame]
Daniel Dunbare9758242009-11-29 09:33:20 +00001// RUN: clang-cc -emit-llvm -o - %s -stack-protector 0 | FileCheck -check-prefix=NOSSP %s
Daniel Dunbar4930e332009-11-17 08:07:36 +00002// NOSSP: define void @test1(i8* %msg) nounwind {
Daniel Dunbare9758242009-11-29 09:33:20 +00003// RUN: clang-cc -emit-llvm -o - %s -stack-protector 1 | FileCheck -check-prefix=WITHSSP %s
Daniel Dunbar4930e332009-11-17 08:07:36 +00004// WITHSSP: define void @test1(i8* %msg) nounwind ssp {
Daniel Dunbare9758242009-11-29 09:33:20 +00005// RUN: clang-cc -emit-llvm -o - %s -stack-protector 2 | FileCheck -check-prefix=SSPREQ %s
Daniel Dunbar4930e332009-11-17 08:07:36 +00006// SSPREQ: define void @test1(i8* %msg) nounwind sspreq {
Bill Wendlingd63bbad2009-06-28 07:36:13 +00007
Mike Stumpf8c1f0d2009-10-08 23:05:06 +00008int printf(const char * _Format, ...);
Bill Wendlingd63bbad2009-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}