diff --git a/lld/test/elf2/libsearch.s b/lld/test/elf2/libsearch.s index 38f9e4954ede..30aa4ff66d63 100644 --- a/lld/test/elf2/libsearch.s +++ b/lld/test/elf2/libsearch.s @@ -3,10 +3,11 @@ // RUN: %p/Inputs/libsearch-dyn.s -o %tdyn.o // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \ // RUN: %p/Inputs/libsearch-st.s -o %tst.o -// RUN: ld.lld2 -shared %tdyn.o -o %T/libls.so -// RUN: cp -f %T/libls.so %T/libls2.so -// RUN: rm -f %T/libls.a -// RUN: llvm-ar rcs %T/libls.a %tst.o +// RUN: mkdir -p %t.dir +// RUN: ld.lld2 -shared %tdyn.o -o %t.dir/libls.so +// RUN: cp -f %t.dir/libls.so %t.dir/libls2.so +// RUN: rm -f %t.dir/libls.a +// RUN: llvm-ar rcs %t.dir/libls.a %tst.o // REQUIRES: x86 // Should not link because of undefined symbol _bar @@ -20,56 +21,56 @@ // NOLIB: Unable to find library -lls // Should use explicitly specified static library -// RUN: ld.lld2 -o %t3 %t.o -L%T -l:libls.a +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -l:libls.a // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=STATIC %s // STATIC: Symbols [ // STATIC: Name: _static // STATIC: ] // Should use explicitly specified dynamic library -// RUN: ld.lld2 -o %t3 %t.o -L%T -l:libls.so +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -l:libls.so // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=DYNAMIC %s // DYNAMIC: Symbols [ // DYNAMIC-NOT: Name: _static // DYNAMIC: ] // Should prefer dynamic to static -// RUN: ld.lld2 -o %t3 %t.o -L%T -lls +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -lls // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=DYNAMIC %s // -L can be placed after -l -// RUN: ld.lld2 -o %t3 %t.o -lls -L%T +// RUN: ld.lld2 -o %t3 %t.o -lls -L%t.dir // Check long forms as well -// RUN: ld.lld2 -o %t3 %t.o --library-path=%T --library=ls +// RUN: ld.lld2 -o %t3 %t.o --library-path=%t.dir --library=ls // Should not search for dynamic libraries if -Bstatic is specified -// RUN: ld.lld2 -o %t3 %t.o -L%T -Bstatic -lls +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -Bstatic -lls // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=STATIC %s -// RUN: not ld.lld2 -o %t3 %t.o -L%T -Bstatic -lls2 2>&1 \ +// RUN: not ld.lld2 -o %t3 %t.o -L%t.dir -Bstatic -lls2 2>&1 \ // RUN: | FileCheck --check-prefix=NOLIB2 %s // NOLIB2: Unable to find library -lls2 // -Bdynamic should restore default behaviour -// RUN: ld.lld2 -o %t3 %t.o -L%T -Bstatic -Bdynamic -lls +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -Bstatic -Bdynamic -lls // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=DYNAMIC %s // -Bstatic and -Bdynamic should affect only libraries which follow them -// RUN: ld.lld2 -o %t3 %t.o -L%T -lls -Bstatic -Bdynamic +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -lls -Bstatic -Bdynamic // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=DYNAMIC %s -// RUN: ld.lld2 -o %t3 %t.o -L%T -Bstatic -lls -Bdynamic +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -Bstatic -lls -Bdynamic // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=STATIC %s // Check aliases as well -// RUN: ld.lld2 -o %t3 %t.o -L%T -dn -lls +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -dn -lls // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=STATIC %s -// RUN: ld.lld2 -o %t3 %t.o -L%T -non_shared -lls +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -non_shared -lls // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=STATIC %s -// RUN: ld.lld2 -o %t3 %t.o -L%T -static -lls +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -static -lls // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=STATIC %s -// RUN: ld.lld2 -o %t3 %t.o -L%T -Bstatic -dy -lls +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -Bstatic -dy -lls // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=DYNAMIC %s -// RUN: ld.lld2 -o %t3 %t.o -L%T -Bstatic -call_shared -lls +// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -Bstatic -call_shared -lls // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=DYNAMIC %s .globl _start,_bar; diff --git a/lld/test/elf2/linkerscript2.s b/lld/test/elf2/linkerscript2.s index faad7641bf63..6e09559b2f73 100644 --- a/lld/test/elf2/linkerscript2.s +++ b/lld/test/elf2/linkerscript2.s @@ -2,8 +2,9 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd \ # RUN: %p/Inputs/libsearch-dyn.s -o %tdyn.o -# RUN: ld.lld2 -shared %tdyn.o -o %T/libls.so -# RUN: echo "SEARCH_DIR(" %T ")" > %t.script +# RUN: mkdir -p %t.dir +# RUN: ld.lld2 -shared %tdyn.o -o %t.dir/libls.so +# RUN: echo "SEARCH_DIR(" %t.dir ")" > %t.script # RUN: ld.lld2 -o %t2 --script %t.script -lls %t .globl _start,_bar