[lld] r263070 - [lto] Add saving the LTO .o file to -save-temps.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 4 17:53:17 PDT 2016


On Sat, Jun 4, 2016 at 5:33 PM, Davide Italiano <davide at freebsd.org> wrote:
> On Sat, Jun 4, 2016 at 5:18 PM, Sean Silva via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>>
>>
>> On Sat, Jun 4, 2016 at 4:52 PM, Rafael EspĂ­ndola
>> <rafael.espindola at gmail.com> wrote:
>>>
>>> I think this test needs to create a temporary directory and cd into it:
>>>
>>> llvm-nm a.out | FileCheck %s
>>>
>>> this could be using a a.out from some other test if the scheduling is
>>> just right.
>>
>>
>> Good catch. I was staring at my original test case in this patch which had
>> explicit `-o`..
>>
>> It looks like this issue was likely introduced in
>> http://llvm.org/klaus/lld/commit/e60c3351266e56d91bfd60f34d36edbbb3a1c5e1/
>>

Index: test/ELF/lto/save-temps.ll
===================================================================
--- test/ELF/lto/save-temps.ll (revision 271819)
+++ test/ELF/lto/save-temps.ll (working copy)
@@ -1,7 +1,9 @@
 ; REQUIRES: x86
-; RUN: rm -f a.out a.out.lto.bc a.out.lto.o
+; RUN: cd %T
+; RUN: rm -f %t.ll a.out a.out.lto.bc a.out.lto.o
+; RUN: cp %p/Inputs/save-temps.ll %t.ll
 ; RUN: llvm-as %s -o %t.o
-; RUN: llvm-as %p/Inputs/save-temps.ll -o %t2.o
+; RUN: llvm-as %t.ll -o %t2.o
 ; RUN: ld.lld -shared -m elf_x86_64 %t.o %t2.o -save-temps
 ; RUN: llvm-nm a.out | FileCheck %s
 ; RUN: llvm-nm a.out.lto.bc | FileCheck %s

Something like this?

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-commits mailing list