Bill Wendling | 45483f7 | 2009-06-28 07:36:13 +0000 | [diff] [blame] | 1 | // 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 && |
| 13 | // RUN: true |
| 14 | |
Mike Stump | 76bee4b | 2009-10-08 23:05:06 +0000 | [diff] [blame] | 15 | int printf(const char * _Format, ...); |
Bill Wendling | 45483f7 | 2009-06-28 07:36:13 +0000 | [diff] [blame] | 16 | |
| 17 | void test1(const char *msg) { |
| 18 | char a[strlen(msg) + 1]; |
| 19 | strcpy(a, msg); |
| 20 | printf("%s\n", a); |
| 21 | } |