aboutsummaryrefslogtreecommitdiffstats
path: root/test/FrontendC
diff options
context:
space:
mode:
Diffstat (limited to 'test/FrontendC')
-rw-r--r--test/FrontendC/2003-12-14-ExternInlineSupport.c2
-rw-r--r--test/FrontendC/2007-02-16-WritableStrings.c2
-rw-r--r--test/FrontendC/2007-09-17-WeakRef.c2
-rw-r--r--test/FrontendC/2010-02-10-PointerName.c7
-rw-r--r--test/FrontendC/2010-02-15-DbgStaticVar.c13
-rw-r--r--test/FrontendC/2010-02-16-DbgVarScope.c30
-rw-r--r--test/FrontendC/2010-02-18-Dbg-VectorType.c9
-rw-r--r--test/FrontendC/2010-03-5-LexicalScope.c10
8 files changed, 72 insertions, 3 deletions
diff --git a/test/FrontendC/2003-12-14-ExternInlineSupport.c b/test/FrontendC/2003-12-14-ExternInlineSupport.c
index 510d1f8..fb92ec7 100644
--- a/test/FrontendC/2003-12-14-ExternInlineSupport.c
+++ b/test/FrontendC/2003-12-14-ExternInlineSupport.c
@@ -1,3 +1,3 @@
-// RUN: %llvmgcc -Os -xc %s -c -o - | llvm-dis | not grep dead_function
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | not grep dead_function
extern __inline__ void dead_function() {}
diff --git a/test/FrontendC/2007-02-16-WritableStrings.c b/test/FrontendC/2007-02-16-WritableStrings.c
index 811e330..0f281ce 100644
--- a/test/FrontendC/2007-02-16-WritableStrings.c
+++ b/test/FrontendC/2007-02-16-WritableStrings.c
@@ -1,7 +1,7 @@
// Test the -fwritable-strings option.
// RUN: %llvmgcc -O3 -S -o - -emit-llvm -fwritable-strings %s | \
-// RUN: grep {private global}
+// RUN: grep {internal global}
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {private constant}
char *X = "foo";
diff --git a/test/FrontendC/2007-09-17-WeakRef.c b/test/FrontendC/2007-09-17-WeakRef.c
index 3cdd47e..6c420ea 100644
--- a/test/FrontendC/2007-09-17-WeakRef.c
+++ b/test/FrontendC/2007-09-17-WeakRef.c
@@ -1,6 +1,6 @@
// RUN: %llvmgcc -O1 -S %s -o - | grep icmp
// PR1678
-// XFAIL: llvmgcc4.0.1
+
extern void B (void);
static __typeof(B) A __attribute__ ((__weakref__("B")));
int active (void)
diff --git a/test/FrontendC/2010-02-10-PointerName.c b/test/FrontendC/2010-02-10-PointerName.c
new file mode 100644
index 0000000..7880fa8
--- /dev/null
+++ b/test/FrontendC/2010-02-10-PointerName.c
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc %s -S -g -o - | grep DW_TAG_pointer_type | grep -v char
+
+char i = 1;
+void foo() {
+ char *cp = &i;
+}
+
diff --git a/test/FrontendC/2010-02-15-DbgStaticVar.c b/test/FrontendC/2010-02-15-DbgStaticVar.c
new file mode 100644
index 0000000..7827d96
--- /dev/null
+++ b/test/FrontendC/2010-02-15-DbgStaticVar.c
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -g -S %s -o - | grep "metadata ..b., metadata ..b., metadata ...,"
+// Test to check intentionally empty linkage name for a static variable.
+// Radar 7651244.
+static int foo(int a)
+{
+ static int b = 1;
+ return b+a;
+}
+
+int main() {
+ int j = foo(1);
+ return 0;
+}
diff --git a/test/FrontendC/2010-02-16-DbgVarScope.c b/test/FrontendC/2010-02-16-DbgVarScope.c
new file mode 100644
index 0000000..1d912d0
--- /dev/null
+++ b/test/FrontendC/2010-02-16-DbgVarScope.c
@@ -0,0 +1,30 @@
+// RUN: %llvmgcc -S -O0 -g %s -o - | \
+// RUN: llc --disable-fp-elim -o %t.s -O0 -relocation-model=pic
+// RUN: %compile_c %t.s -o %t.o
+// RUN: %link %t.o -o %t.exe
+// RUN: echo {break 24\nrun\np loc\n} > %t.in
+// RN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | \
+// RN: grep {$1 = 1}
+
+int g1 = 1;
+int g2 = 2;
+
+int __attribute__((always_inline)) bar() {
+ return g2 - g1;
+}
+void foobar() {}
+
+void foo(int s) {
+ unsigned loc = 0;
+ if (s) {
+ loc = 1;
+ foobar();
+ } else {
+ loc = bar();
+ foobar();
+ }
+}
+
+int main() {
+ foo(0);
+}
diff --git a/test/FrontendC/2010-02-18-Dbg-VectorType.c b/test/FrontendC/2010-02-18-Dbg-VectorType.c
new file mode 100644
index 0000000..d34031f
--- /dev/null
+++ b/test/FrontendC/2010-02-18-Dbg-VectorType.c
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc -S -O0 -g %s -o - | grep DW_TAG_typedef | grep float4
+typedef float float4 __attribute__((vector_size(16)));
+
+int main(){
+ volatile float4 x = (float4) { 0.0f, 1.0f, 2.0f, 3.0f };
+ x += x;
+ return 0;
+}
+
diff --git a/test/FrontendC/2010-03-5-LexicalScope.c b/test/FrontendC/2010-03-5-LexicalScope.c
new file mode 100644
index 0000000..93a841a
--- /dev/null
+++ b/test/FrontendC/2010-03-5-LexicalScope.c
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S -O0 -g %s -o - | grep DW_TAG_lexical_block | count 3
+int foo(int i) {
+ if (i) {
+ int j = 2;
+ }
+ else {
+ int j = 3;
+ }
+ return i;
+}