blob: bdac853aed628b221b5679490feb18915619c47c [file] [log] [blame]
Bill Wendling45483f72009-06-28 07:36:13 +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 &&
13// RUN: true
14
15#include <stdio.h>
16#include <string.h>
17
18void test1(const char *msg) {
19 char a[strlen(msg) + 1];
20 strcpy(a, msg);
21 printf("%s\n", a);
22}