summaryrefslogtreecommitdiff
path: root/test/Linker/Inputs
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
commit7e621f3242108121139c81e9f71f0e15a4d0aa76 (patch)
treea96b55651ec1c53e21241b92b88e780c274b46aa /test/Linker/Inputs
parent3e25c4a1e3e58bc1d00d894854a29dd2e4e7e88a (diff)
downloadllvm-7e621f3242108121139c81e9f71f0e15a4d0aa76.tar.gz
llvm-7e621f3242108121139c81e9f71f0e15a4d0aa76.tar.bz2
llvm-7e621f3242108121139c81e9f71f0e15a4d0aa76.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Linker/Inputs')
-rw-r--r--test/Linker/Inputs/PR11464.a.ll3
-rw-r--r--test/Linker/Inputs/PR11464.b.ll13
-rw-r--r--test/Linker/Inputs/PR8300.a.ll2
-rw-r--r--test/Linker/Inputs/PR8300.b.ll9
-rw-r--r--test/Linker/Inputs/basiclink.a.ll2
-rw-r--r--test/Linker/Inputs/basiclink.b.ll6
-rw-r--r--test/Linker/Inputs/linkage.a.ll2
-rw-r--r--test/Linker/Inputs/linkage.b.ll10
8 files changed, 47 insertions, 0 deletions
diff --git a/test/Linker/Inputs/PR11464.a.ll b/test/Linker/Inputs/PR11464.a.ll
new file mode 100644
index 0000000000..25a93500de
--- /dev/null
+++ b/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/test/Linker/Inputs/PR11464.b.ll b/test/Linker/Inputs/PR11464.b.ll
new file mode 100644
index 0000000000..7ef5a36129
--- /dev/null
+++ b/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/test/Linker/Inputs/PR8300.a.ll b/test/Linker/Inputs/PR8300.a.ll
new file mode 100644
index 0000000000..c705db3fd0
--- /dev/null
+++ b/test/Linker/Inputs/PR8300.a.ll
@@ -0,0 +1,2 @@
+%foo2 = type { [8 x i8] }
+declare void @zed(%foo2*)
diff --git a/test/Linker/Inputs/PR8300.b.ll b/test/Linker/Inputs/PR8300.b.ll
new file mode 100644
index 0000000000..9e538f5d28
--- /dev/null
+++ b/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/test/Linker/Inputs/basiclink.a.ll b/test/Linker/Inputs/basiclink.a.ll
new file mode 100644
index 0000000000..997932d4fa
--- /dev/null
+++ b/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/test/Linker/Inputs/basiclink.b.ll b/test/Linker/Inputs/basiclink.b.ll
new file mode 100644
index 0000000000..0d2abc771c
--- /dev/null
+++ b/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/test/Linker/Inputs/linkage.a.ll b/test/Linker/Inputs/linkage.a.ll
new file mode 100644
index 0000000000..8a156f669a
--- /dev/null
+++ b/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/test/Linker/Inputs/linkage.b.ll b/test/Linker/Inputs/linkage.b.ll
new file mode 100644
index 0000000000..0ada3f4cb4
--- /dev/null
+++ b/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
+}
+