summaryrefslogtreecommitdiffstats
path: root/llvm/test/Linker
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-05-18 03:46:50 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-05-18 03:46:50 +0000
commit7aed8fccfdd6d187e5668c23c921196c7f0175d6 (patch)
treef98c80f0af007536153d1e18e39b2b45171cf197 /llvm/test/Linker
parentd266c18c0eaae22aa428f8a1f04bbd481d21ef81 (diff)
downloadbcm5719-llvm-7aed8fccfdd6d187e5668c23c921196c7f0175d6.tar.gz
bcm5719-llvm-7aed8fccfdd6d187e5668c23c921196c7f0175d6.zip
Add a test case for PR1434
llvm-svn: 37203
Diffstat (limited to 'llvm/test/Linker')
-rw-r--r--llvm/test/Linker/link-archive.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Linker/link-archive.ll b/llvm/test/Linker/link-archive.ll
new file mode 100644
index 00000000000..43cf3f36ca3
--- /dev/null
+++ b/llvm/test/Linker/link-archive.ll
@@ -0,0 +1,15 @@
+; Test linking of a bc file to an archive via llvm-ld.
+; PR1434
+; RUN: llvm-as %s -o %t.bar.bc -f
+; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
+; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -f
+; RUN: llvm-ar rf %t.foo.a %t.foo.bc
+; RUN: llvm-ar rf %t.bar.a %t.bar.bc
+; RUN: llvm-ld -disable-opt %t.bar.bc %t.foo.a -o %t.bc
+; RUN: llvm-ld -disable-opt %t.foo.bc %t.bar.a -o %t.bc
+declare i32* @foo(...)
+define i32* @bar() {
+ %ret = call i32* (...)* @foo( i32 123 )
+ ret i32* %ret
+}
+@baz = global i32 0
OpenPOWER on IntegriCloud