[lld] 5562423 - [LLD][COFF] Avoid overwriting inputs in tests

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 12:09:07 PDT 2020


Author: Alexandre Ganea
Date: 2020-09-24T15:01:25-04:00
New Revision: 55624237be725a6feef84db7f46147335e68ebab

URL: https://github.com/llvm/llvm-project/commit/55624237be725a6feef84db7f46147335e68ebab
DIFF: https://github.com/llvm/llvm-project/commit/55624237be725a6feef84db7f46147335e68ebab.diff

LOG: [LLD][COFF] Avoid overwriting inputs in tests

Before this patch, these two tests were emitting both a .DLL and .LIB. The output .LIB file name also happens to be an input .LIB file name. This prevented the test from executing a second time when LLD is re-entrant (LLD_IN_TEST=2).

This is a support patch for https://reviews.llvm.org/D70378.

Added: 
    

Modified: 
    lld/test/COFF/dll.test
    lld/test/COFF/guardcf-lto.ll

Removed: 
    


################################################################################
diff  --git a/lld/test/COFF/dll.test b/lld/test/COFF/dll.test
index 338feb850d9c..05f6b4fa9c25 100644
--- a/lld/test/COFF/dll.test
+++ b/lld/test/COFF/dll.test
@@ -13,10 +13,10 @@ EXPORT-NEXT:       2   0x1010  exportfn2
 EXPORT-NEXT:       3   0x1010  exportfn3
 EXPORT-NEXT:       4   0x1010  mangled
 
-# RUN: yaml2obj %p/Inputs/export2.yaml -o %t5.obj
-# RUN: rm -f %t5.lib
-# RUN: llvm-ar cru %t5.lib %t5.obj
-# RUN: lld-link /out:%t5.dll /dll %t.obj %t5.lib /export:mangled2
+# RUN: yaml2obj %p/Inputs/export2.yaml -o %t4.obj
+# RUN: rm -f %t4.lib
+# RUN: llvm-ar cru %t4.lib %t4.obj
+# RUN: lld-link /out:%t5.dll /dll %t.obj %t4.lib /export:mangled2
 # RUN: llvm-objdump -p %t5.dll | FileCheck --check-prefix=EXPORT2 %s
 
 EXPORT2:      Export Table:

diff  --git a/lld/test/COFF/guardcf-lto.ll b/lld/test/COFF/guardcf-lto.ll
index a7f4568968cb..e3655377a9f6 100644
--- a/lld/test/COFF/guardcf-lto.ll
+++ b/lld/test/COFF/guardcf-lto.ll
@@ -8,8 +8,8 @@
 ; RUN: llvm-mc -triple x86_64-windows-msvc -filetype=obj %S/Inputs/loadconfig-cfg-x64.s -o %t.ldcfg.obj
 
 ; RUN: llvm-as %s -o %t.bc
-; RUN: lld-link -entry:main -guard:cf -dll %t.bc %t.lib %t.ldcfg.obj -out:%t.dll
-; RUN: llvm-readobj --coff-load-config %t.dll | FileCheck %s
+; RUN: lld-link -entry:main -guard:cf -dll %t.bc %t.lib %t.ldcfg.obj -out:%t2.dll
+; RUN: llvm-readobj --coff-load-config %t2.dll | FileCheck %s
 
 ; There must be *two* entries in the table: DLL entry point, and my_handler.
 


        


More information about the llvm-commits mailing list