[lld] 3db2150 - [ELF][test] Add reproduce test for dependent libraries

Andrew Ng via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 05:00:32 PDT 2020


Author: Andrew Ng
Date: 2020-04-08T13:00:08+01:00
New Revision: 3db215089f4838eda5742f620d3dc2f4208ad99b

URL: https://github.com/llvm/llvm-project/commit/3db215089f4838eda5742f620d3dc2f4208ad99b
DIFF: https://github.com/llvm/llvm-project/commit/3db215089f4838eda5742f620d3dc2f4208ad99b.diff

LOG: [ELF][test] Add reproduce test for dependent libraries

Differential Revision: https://reviews.llvm.org/D77659

Added: 
    lld/test/ELF/reproduce-deplibs.s

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/lld/test/ELF/reproduce-deplibs.s b/lld/test/ELF/reproduce-deplibs.s
new file mode 100644
index 000000000000..612f78020d57
--- /dev/null
+++ b/lld/test/ELF/reproduce-deplibs.s
@@ -0,0 +1,23 @@
+# REQUIRES: x86, shell
+
+## The 'shell' requirement is to prevent this test from running by default on
+## Windows as the extraction of the tar archive can cause problems related to
+## path length limits.
+
+# RUN: rm -rf %t.dir
+# RUN: mkdir -p %t.dir
+# RUN: cd %t.dir
+# RUN: echo ".global foo; foo: ret" | \
+# RUN:   llvm-mc -filetype=obj -triple=x86_64 - -o foo.o
+# RUN: llvm-ar rc foo.a foo.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o bar.o
+
+# RUN: ld.lld bar.o -o /dev/null --reproduce repro.tar
+# RUN: tar xf repro.tar
+# RUN: cmp foo.a repro/%:t.dir/foo.a
+
+.globl _start
+_start:
+  call foo
+.section ".deplibs","MS", at llvm_dependent_libraries,1
+.asciz "foo.a"


        


More information about the llvm-commits mailing list