blob: c150759f12bf95cf1c3ff3491c2274004f144e60 [file] [log] [blame]
Daniel Dunbar8b576972009-11-08 01:45:36 +00001// RUN: clang-cc -triple i686-unknown-unknown -emit-llvm -o %t %s
2// RUN: not grep 'ssp' %t
3// RUN: clang-cc -triple i686-apple-darwin9 -emit-llvm -o %t %s
4// RUN: not grep 'ssp' %t
5// RUN: clang-cc -triple i686-apple-darwin10 -emit-llvm -o %t %s
6// RUN: grep 'ssp' %t
7// RUN: clang -fstack-protector-all -emit-llvm -S -o %t %s
8// RUN: grep 'sspreq' %t
9// RUN: clang -fstack-protector -emit-llvm -S -o %t %s
10// RUN: grep 'ssp' %t
11// RUN: clang -fno-stack-protector -emit-llvm -S -o %t %s
12// RUN: not grep 'ssp' %t
Bill Wendlingd63bbad2009-06-28 07:36:13 +000013
Mike Stumpf8c1f0d2009-10-08 23:05:06 +000014int printf(const char * _Format, ...);
Bill Wendlingd63bbad2009-06-28 07:36:13 +000015
16void test1(const char *msg) {
17 char a[strlen(msg) + 1];
18 strcpy(a, msg);
19 printf("%s\n", a);
20}