summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/2009-05-22-callingconv.c2
-rw-r--r--test/CodeGen/2009-06-14-anonymous-union-init.c7
-rw-r--r--test/CodeGen/2009-06-16-inc_test.c3
-rw-r--r--test/CodeGen/2009-06-16-test.c15
-rw-r--r--test/CodeGen/call-knr-indirect.c11
-rw-r--r--test/CodeGen/libcalls.c4
6 files changed, 39 insertions, 3 deletions
diff --git a/test/CodeGen/2009-05-22-callingconv.c b/test/CodeGen/2009-05-22-callingconv.c
index 2b70d840c0617..8afc656843ea6 100644
--- a/test/CodeGen/2009-05-22-callingconv.c
+++ b/test/CodeGen/2009-05-22-callingconv.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -emit-llvm -o - | grep call | grep x86_stdcallcc
+// RUN: clang-cc %s -emit-llvm -o - -triple i386-unknown-unknown | grep call | grep x86_stdcallcc
void abort(void) __attribute__((__noreturn__));
typedef void re_string_t;
typedef void re_dfa_t;
diff --git a/test/CodeGen/2009-06-14-anonymous-union-init.c b/test/CodeGen/2009-06-14-anonymous-union-init.c
new file mode 100644
index 0000000000000..8d1831a4f3ce2
--- /dev/null
+++ b/test/CodeGen/2009-06-14-anonymous-union-init.c
@@ -0,0 +1,7 @@
+// RUN: clang-cc -emit-llvm < %s | grep "zeroinitializer, i16 16877"
+// PR4390
+struct sysfs_dirent {
+ union { struct sysfs_elem_dir {} s_dir; };
+ unsigned short s_mode;
+};
+struct sysfs_dirent sysfs_root = { {}, 16877 };
diff --git a/test/CodeGen/2009-06-16-inc_test.c b/test/CodeGen/2009-06-16-inc_test.c
new file mode 100644
index 0000000000000..b28f63a1c580e
--- /dev/null
+++ b/test/CodeGen/2009-06-16-inc_test.c
@@ -0,0 +1,3 @@
+// RUN: clang -c -g %s -o /dev/null
+// PR 4228
+#include "2009-06-16-test.c"
diff --git a/test/CodeGen/2009-06-16-test.c b/test/CodeGen/2009-06-16-test.c
new file mode 100644
index 0000000000000..4189d06812af7
--- /dev/null
+++ b/test/CodeGen/2009-06-16-test.c
@@ -0,0 +1,15 @@
+
+#ifndef TEST
+#define TEST
+#define INSIDE_RECURSION
+#include "2009-06-16-test.c"
+#undef INSIDE_RECURSION
+#endif
+
+#ifndef INSIDE_RECURSION
+int i;
+#endif
+
+#ifdef INSIDE_RECURSION
+int j;
+#endif
diff --git a/test/CodeGen/call-knr-indirect.c b/test/CodeGen/call-knr-indirect.c
new file mode 100644
index 0000000000000..17be015bffb19
--- /dev/null
+++ b/test/CodeGen/call-knr-indirect.c
@@ -0,0 +1,11 @@
+// RUN: clang %s -O0 -emit-llvm -S -o - | grep 'call.*rb_define_global_function'
+// This should call rb_define_global_function, not rb_f_chop.
+
+void rb_define_global_function (const char*,void(*)(),int);
+static void rb_f_chop();
+void Init_String() {
+ rb_define_global_function("chop", rb_f_chop, 0);
+}
+static void rb_f_chop() {
+}
+
diff --git a/test/CodeGen/libcalls.c b/test/CodeGen/libcalls.c
index 695321622fed6..ea9e0c3dd91b3 100644
--- a/test/CodeGen/libcalls.c
+++ b/test/CodeGen/libcalls.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -fmath-errno=1 -emit-llvm -o %t %s &&
+// RUN: clang-cc -fmath-errno=1 -emit-llvm -o %t %s -triple i386-unknown-unknown &&
// RUN: grep "declare " %t | count 6 &&
// RUN: grep "declare " %t | grep "@llvm." | count 1 &&
-// RUN: clang-cc -fmath-errno=0 -emit-llvm -o %t %s &&
+// RUN: clang-cc -fmath-errno=0 -emit-llvm -o %t %s -triple i386-unknown-unknown &&
// RUN: grep "declare " %t | count 6 &&
// RUN: grep "declare " %t | grep -v "@llvm." | count 0