[lld] Avoid creating files outside of work directory.
authorStephan Herhut <herhut@google.com>
Wed, 4 Mar 2020 13:39:58 +0000 (14:39 +0100)
committerStephan Herhut <herhut@google.com>
Wed, 4 Mar 2020 13:46:12 +0000 (14:46 +0100)
Summary:
A test is passing `-o -` to lld in the hope of writing the output to
standard out but that is not the case. Instead it creates a file named
`-.lto.o`. This fixes it by creating a temporary file in the work
directory.

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

lld/test/ELF/lto/thinlto.ll

index 7efdf68..2a7ffb9 100644 (file)
@@ -26,7 +26,7 @@
 ; RUN: mkdir -p %t.dir
 ; RUN: cp %t2.o %t.dir/t.o
 ; RUN: llvm-ar rcsT %t.dir/t.a %t.dir/t.o
-; RUN: ld.lld -save-temps %t1.o %t.dir/t.a -o - > /dev/null
+; RUN: ld.lld -save-temps %t1.o %t.dir/t.a -o %t.null
 ; RUN: ls '%t.dir/t.a(t.o at 0).0.preopt.bc'
 
 ; NM1: T f