summaryrefslogtreecommitdiff
path: root/test/ELF/archive-fetch.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/archive-fetch.s')
-rw-r--r--test/ELF/archive-fetch.s15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ELF/archive-fetch.s b/test/ELF/archive-fetch.s
new file mode 100644
index 000000000000..201218f4cc26
--- /dev/null
+++ b/test/ELF/archive-fetch.s
@@ -0,0 +1,15 @@
+# REQUIRES: x86
+
+# We have a code in LLD that prevents fetching the same object from archive file twice.
+# This test triggers that code, without it we would fail to link output.
+
+# RUN: echo '.globl foo, bar; foo:' | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %tfoo.o
+# RUN: echo '.globl foo, bar; bar:' | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %tbar.o
+# RUN: rm -f %t.a
+# RUN: llvm-ar rcs %t.a %tfoo.o %tbar.o
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+# RUN: ld.lld %t.a %t.o -o /dev/null
+
+_start:
+callq foo