[lld] 573c9d6 - [lld] Avoid creating files outside of work directory.

Stephan Herhut via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 05:46:50 PST 2020


Author: Stephan Herhut
Date: 2020-03-04T14:46:12+01:00
New Revision: 573c9d666c0fa8a4c6787f873bebf3f6ec4de7cc

URL: https://github.com/llvm/llvm-project/commit/573c9d666c0fa8a4c6787f873bebf3f6ec4de7cc
DIFF: https://github.com/llvm/llvm-project/commit/573c9d666c0fa8a4c6787f873bebf3f6ec4de7cc.diff

LOG: [lld] Avoid creating files outside of work directory.

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

Added: 
    

Modified: 
    lld/test/ELF/lto/thinlto.ll

Removed: 
    


################################################################################
diff  --git a/lld/test/ELF/lto/thinlto.ll b/lld/test/ELF/lto/thinlto.ll
index 7efdf68c0e2d..2a7ffb90f6ff 100644
--- a/lld/test/ELF/lto/thinlto.ll
+++ b/lld/test/ELF/lto/thinlto.ll
@@ -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


        


More information about the llvm-commits mailing list