summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-07-02 10:18:06 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-07-02 10:18:06 +0000
commit8bdfe1ec92a6c28791a65a05de7eede2302705a4 (patch)
treea538a5d42b94be267825a14821e42ea0a37d3856
parentb13099c26e3be1a072cb87bed79fbcc649572e97 (diff)
downloadbcm5719-llvm-8bdfe1ec92a6c28791a65a05de7eede2302705a4.tar.gz
bcm5719-llvm-8bdfe1ec92a6c28791a65a05de7eede2302705a4.zip
Switch a bunch of Linker tests from using elaborate echo productions to
just provide and reference separate input files from an Inputs subdirectory. This pattern works very well in the Clang tree and is easier to understand in my opinion. It also has fewer limitations and will remove one particularly annoying use of TCL-style {} quoting from the testsuite. Also teach the LLVM lit configuration to avoid recursing into 'Inputs' subdirectories. This wasn't required for the previous 'Inputs' subdirectories used due to fortuitous suffix patterns. This is the first step to completely removing support for TCL-style tests. llvm-svn: 159520
-rw-r--r--llvm/test/Linker/2003-04-21-Linkage.ll14
-rw-r--r--llvm/test/Linker/Inputs/PR11464.a.ll3
-rw-r--r--llvm/test/Linker/Inputs/PR11464.b.ll13
-rw-r--r--llvm/test/Linker/Inputs/PR8300.a.ll2
-rw-r--r--llvm/test/Linker/Inputs/PR8300.b.ll9
-rw-r--r--llvm/test/Linker/Inputs/basiclink.a.ll2
-rw-r--r--llvm/test/Linker/Inputs/basiclink.b.ll6
-rw-r--r--llvm/test/Linker/Inputs/linkage.a.ll2
-rw-r--r--llvm/test/Linker/Inputs/linkage.b.ll10
-rw-r--r--llvm/test/Linker/PR8300.ll14
-rw-r--r--llvm/test/Linker/basiclink.ll13
-rw-r--r--llvm/test/Linker/linkage.ll3
-rw-r--r--llvm/test/Linker/multiple-merged-structs.ll19
-rw-r--r--llvm/test/lit.cfg5
14 files changed, 60 insertions, 55 deletions
diff --git a/llvm/test/Linker/2003-04-21-Linkage.ll b/llvm/test/Linker/2003-04-21-Linkage.ll
deleted file mode 100644
index f6d4c4b03b7..00000000000
--- a/llvm/test/Linker/2003-04-21-Linkage.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: echo {@X = linkonce global i32 5 \
-; RUN: define linkonce i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
-; RUN: llvm-as %s -o %t.2.bc
-; RUN: llvm-link %t.1.bc %t.2.bc
-@X = external global i32
-
-declare i32 @foo()
-
-define void @bar() {
- load i32* @X
- call i32 @foo()
- ret void
-}
-
diff --git a/llvm/test/Linker/Inputs/PR11464.a.ll b/llvm/test/Linker/Inputs/PR11464.a.ll
new file mode 100644
index 00000000000..25a93500ded
--- /dev/null
+++ b/llvm/test/Linker/Inputs/PR11464.a.ll
@@ -0,0 +1,3 @@
+%bug_type = type opaque
+declare i32 @bug_a(%bug_type*)
+declare i32 @bug_b(%bug_type*)
diff --git a/llvm/test/Linker/Inputs/PR11464.b.ll b/llvm/test/Linker/Inputs/PR11464.b.ll
new file mode 100644
index 00000000000..7ef5a361291
--- /dev/null
+++ b/llvm/test/Linker/Inputs/PR11464.b.ll
@@ -0,0 +1,13 @@
+%bug_type = type { %bug_type* }
+%bar = type { i32 }
+
+define i32 @bug_a(%bug_type* %fp) nounwind uwtable {
+entry:
+ %d_stream = getelementptr inbounds %bug_type* %fp, i64 0, i32 0
+ ret i32 0
+}
+
+define i32 @bug_b(%bar* %a) nounwind uwtable {
+entry:
+ ret i32 0
+}
diff --git a/llvm/test/Linker/Inputs/PR8300.a.ll b/llvm/test/Linker/Inputs/PR8300.a.ll
new file mode 100644
index 00000000000..c705db3fd00
--- /dev/null
+++ b/llvm/test/Linker/Inputs/PR8300.a.ll
@@ -0,0 +1,2 @@
+%foo2 = type { [8 x i8] }
+declare void @zed(%foo2*)
diff --git a/llvm/test/Linker/Inputs/PR8300.b.ll b/llvm/test/Linker/Inputs/PR8300.b.ll
new file mode 100644
index 00000000000..9e538f5d286
--- /dev/null
+++ b/llvm/test/Linker/Inputs/PR8300.b.ll
@@ -0,0 +1,9 @@
+%foo = type { [8 x i8] }
+%bar = type { [9 x i8] }
+
+@zed = alias bitcast (void (%bar*)* @xyz to void (%foo*)*)
+
+define void @xyz(%bar* %this) {
+entry:
+ ret void
+}
diff --git a/llvm/test/Linker/Inputs/basiclink.a.ll b/llvm/test/Linker/Inputs/basiclink.a.ll
new file mode 100644
index 00000000000..997932d4fa7
--- /dev/null
+++ b/llvm/test/Linker/Inputs/basiclink.a.ll
@@ -0,0 +1,2 @@
+define i32* @foo(i32 %x) { ret i32* @baz }
+@baz = external global i32
diff --git a/llvm/test/Linker/Inputs/basiclink.b.ll b/llvm/test/Linker/Inputs/basiclink.b.ll
new file mode 100644
index 00000000000..0d2abc771c6
--- /dev/null
+++ b/llvm/test/Linker/Inputs/basiclink.b.ll
@@ -0,0 +1,6 @@
+declare i32* @foo(...)
+define i32* @bar() {
+ %ret = call i32* (...)* @foo( i32 123 )
+ ret i32* %ret
+}
+@baz = global i32 0
diff --git a/llvm/test/Linker/Inputs/linkage.a.ll b/llvm/test/Linker/Inputs/linkage.a.ll
new file mode 100644
index 00000000000..8a156f669a4
--- /dev/null
+++ b/llvm/test/Linker/Inputs/linkage.a.ll
@@ -0,0 +1,2 @@
+@X = linkonce global i32 5
+define linkonce i32 @foo() { ret i32 7 }
diff --git a/llvm/test/Linker/Inputs/linkage.b.ll b/llvm/test/Linker/Inputs/linkage.b.ll
new file mode 100644
index 00000000000..0ada3f4cb42
--- /dev/null
+++ b/llvm/test/Linker/Inputs/linkage.b.ll
@@ -0,0 +1,10 @@
+@X = external global i32
+
+declare i32 @foo()
+
+define void @bar() {
+ load i32* @X
+ call i32 @foo()
+ ret void
+}
+
diff --git a/llvm/test/Linker/PR8300.ll b/llvm/test/Linker/PR8300.ll
index f0fc1e7a5cc..7c03d5bb4ee 100644
--- a/llvm/test/Linker/PR8300.ll
+++ b/llvm/test/Linker/PR8300.ll
@@ -1,13 +1 @@
-; RUN: echo {%foo2 = type \{ \[8 x i8\] \} \
-; RUN: declare void @zed(%foo2*) } > %t.ll
-; RUN: llvm-link %t.ll %s -o %t.bc
-
-%foo = type { [8 x i8] }
-%bar = type { [9 x i8] }
-
-@zed = alias bitcast (void (%bar*)* @xyz to void (%foo*)*)
-
-define void @xyz(%bar* %this) {
-entry:
- ret void
-}
+; RUN: llvm-link %S/Inputs/PR8300.a.ll %S/Inputs/PR8300.b.ll -o %t.bc
diff --git a/llvm/test/Linker/basiclink.ll b/llvm/test/Linker/basiclink.ll
index afe0320ba92..804329a49c9 100644
--- a/llvm/test/Linker/basiclink.ll
+++ b/llvm/test/Linker/basiclink.ll
@@ -1,13 +1,6 @@
; Test linking two functions with different prototypes and two globals
; in different modules. This is for PR411
-; RUN: llvm-as %s -o %t.bar.bc
-; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
-; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc
-; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc
+; RUN: llvm-as %S/Inputs/basiclink.a.ll -o %t.foo.bc
+; RUN: llvm-as %S/Inputs/basiclink.b.ll -o %t.bar.bc
; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc
-declare i32* @foo(...)
-define i32* @bar() {
- %ret = call i32* (...)* @foo( i32 123 )
- ret i32* %ret
-}
-@baz = global i32 0
+; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc
diff --git a/llvm/test/Linker/linkage.ll b/llvm/test/Linker/linkage.ll
new file mode 100644
index 00000000000..c7309aa8750
--- /dev/null
+++ b/llvm/test/Linker/linkage.ll
@@ -0,0 +1,3 @@
+; RUN: llvm-as %S/Inputs/linkage.a.ll -o %t.1.bc
+; RUN: llvm-as %S/Inputs/linkage.b.ll -o %t.2.bc
+; RUN: llvm-link %t.1.bc %t.2.bc
diff --git a/llvm/test/Linker/multiple-merged-structs.ll b/llvm/test/Linker/multiple-merged-structs.ll
index 348cd89bbc4..aa8204dfebb 100644
--- a/llvm/test/Linker/multiple-merged-structs.ll
+++ b/llvm/test/Linker/multiple-merged-structs.ll
@@ -1,19 +1,2 @@
-; RUN: echo {%bug_type = type opaque \
-; RUN: declare i32 @bug_a(%bug_type*) \
-; RUN: declare i32 @bug_b(%bug_type*) } > %t.ll
-; RUN: llvm-link %t.ll %s
+; RUN: llvm-link %S/Inputs/PR11464.a.ll %S/Inputs/PR11464.b.ll
; PR11464
-
-%bug_type = type { %bug_type* }
-%bar = type { i32 }
-
-define i32 @bug_a(%bug_type* %fp) nounwind uwtable {
-entry:
- %d_stream = getelementptr inbounds %bug_type* %fp, i64 0, i32 0
- ret i32 0
-}
-
-define i32 @bug_b(%bar* %a) nounwind uwtable {
-entry:
- ret i32 0
-}
diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg
index 93360c7c7c2..d4836451906 100644
--- a/llvm/test/lit.cfg
+++ b/llvm/test/lit.cfg
@@ -19,6 +19,11 @@ config.test_format = lit.formats.TclTest()
# set by on_clone().
config.suffixes = []
+# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
+# subdirectories contain auxiliary inputs for various tests in their parent
+# directories.
+config.excludes = ['Inputs']
+
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
OpenPOWER on IntegriCloud