summaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-07-04 13:58:54 +0000
committered <ed@FreeBSD.org>2009-07-04 13:58:54 +0000
commit4981926bf654fe5a2c3893f24ca44106b217e71e (patch)
tree8ddfe382e1c6d590dc240e76f7cd45cea5c78e24 /test/CodeGen
parentc1ff020ff2d3e7ba86f7ab986ac7569c34f2ab1a (diff)
downloadFreeBSD-src-4981926bf654fe5a2c3893f24ca44106b217e71e.zip
FreeBSD-src-4981926bf654fe5a2c3893f24ca44106b217e71e.tar.gz
Import Clang r74788.
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/attributes.c2
-rw-r--r--test/CodeGen/stack-protector.c22
-rw-r--r--test/CodeGen/unwind-attr.c4
3 files changed, 25 insertions, 3 deletions
diff --git a/test/CodeGen/attributes.c b/test/CodeGen/attributes.c
index a5de4f4..8f157f3 100644
--- a/test/CodeGen/attributes.c
+++ b/test/CodeGen/attributes.c
@@ -60,7 +60,7 @@ int t17() {
extern int t18 __attribute__((weak_import));
int t18 = 1;
-// RUN: grep 'define i[0-9]* @t19() nounwind {' %t &&
+// RUN: grep 'define i[0-9]* @t19()' %t &&
extern int t19(void) __attribute__((weak_import));
int t19(void) {
return 10;
diff --git a/test/CodeGen/stack-protector.c b/test/CodeGen/stack-protector.c
new file mode 100644
index 0000000..bdac853
--- /dev/null
+++ b/test/CodeGen/stack-protector.c
@@ -0,0 +1,22 @@
+// RUN: clang-cc -triple i686-unknown-unknown -emit-llvm -o %t %s &&
+// RUN: not grep 'ssp' %t &&
+// RUN: clang-cc -triple i686-apple-darwin9 -emit-llvm -o %t %s &&
+// RUN: not grep 'ssp' %t &&
+// RUN: clang-cc -triple i686-apple-darwin10 -emit-llvm -o %t %s &&
+// RUN: grep 'ssp' %t &&
+// RUN: clang -fstack-protector-all -emit-llvm -S -o %t %s &&
+// RUN: grep 'sspreq' %t &&
+// RUN: clang -fstack-protector -emit-llvm -S -o %t %s &&
+// RUN: grep 'ssp' %t &&
+// RUN: clang -fno-stack-protector -emit-llvm -S -o %t %s &&
+// RUN: not grep 'ssp' %t &&
+// RUN: true
+
+#include <stdio.h>
+#include <string.h>
+
+void test1(const char *msg) {
+ char a[strlen(msg) + 1];
+ strcpy(a, msg);
+ printf("%s\n", a);
+}
diff --git a/test/CodeGen/unwind-attr.c b/test/CodeGen/unwind-attr.c
index b2890c4..4954a0b 100644
--- a/test/CodeGen/unwind-attr.c
+++ b/test/CodeGen/unwind-attr.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -fexceptions -emit-llvm -o - %s | grep "@foo() {" | count 1 &&
-// RUN: clang-cc -emit-llvm -o - %s | grep "@foo() nounwind {" | count 1
+// RUN: clang-cc -fexceptions -emit-llvm -o - %s | grep "@foo()" | not grep nounwind &&
+// RUN: clang-cc -emit-llvm -o - %s | grep "@foo()" | grep nounwind
int foo(void) {
}
OpenPOWER on IntegriCloud