Index: test/COFF/export-all.s =================================================================== --- test/COFF/export-all.s +++ test/COFF/export-all.s @@ -63,6 +63,7 @@ # RUN: mkdir -p %T/libs # RUN: echo -e ".global mingwfunc\n.text\nmingwfunc:\nret\n" > %T/libs/mingwfunc.s # RUN: llvm-mc -triple=x86_64-windows-gnu %T/libs/mingwfunc.s -filetype=obj -o %T/libs/mingwfunc.o +# RUN: rm -f %T/libs/libmingwex.a # RUN: llvm-ar rcs %T/libs/libmingwex.a %T/libs/mingwfunc.o # RUN: echo -e ".global crtfunc\n.text\ncrtfunc:\nret\n" > %T/libs/crtfunc.s # RUN: llvm-mc -triple=x86_64-windows-gnu %T/libs/crtfunc.s -filetype=obj -o %T/libs/crt2.o Index: test/COFF/lto-chkstk.ll =================================================================== --- test/COFF/lto-chkstk.ll +++ test/COFF/lto-chkstk.ll @@ -2,6 +2,7 @@ ; RUN: llvm-as -o %t.obj %s ; RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %T/lto-chkstk-foo.obj %S/Inputs/lto-chkstk-foo.s ; RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %T/lto-chkstk-chkstk.obj %S/Inputs/lto-chkstk-chkstk.s +; RUN: rm -f %t.lib ; RUN: llvm-ar cru %t.lib %T/lto-chkstk-chkstk.obj ; RUN: lld-link /out:%t.exe /entry:main /subsystem:console %t.obj %T/lto-chkstk-foo.obj %t.lib Index: test/COFF/wholearchive.s =================================================================== --- test/COFF/wholearchive.s +++ test/COFF/wholearchive.s @@ -1,6 +1,7 @@ # REQUIRES: x86 # RUN: yaml2obj < %p/Inputs/export.yaml > %t.archive.obj +# RUN: rm -f %t.archive.lib # RUN: llvm-ar rcs %t.archive.lib %t.archive.obj # RUN: llvm-mc -triple=x86_64-windows-msvc %s -filetype=obj -o %t.main.obj Index: test/ELF/conflict.s =================================================================== --- test/ELF/conflict.s +++ test/ELF/conflict.s @@ -26,6 +26,7 @@ # RUN: FileCheck -check-prefix=DEMANGLE %s # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/conflict.s -o %t2.o +# RUN: rm -f %t3.a # RUN: llvm-ar rcs %t3.a %t2.o # RUN: not ld.lld %t1.o %t3.a -u baz -o %t2 2>&1 | FileCheck -check-prefix=ARCHIVE %s Index: test/ELF/gnu-hash-table.s =================================================================== --- test/ELF/gnu-hash-table.s +++ test/ELF/gnu-hash-table.s @@ -13,7 +13,7 @@ # RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %t2.s -o %t2-ppc64le.o # RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %t2.s -o %t2-ppc64.o -# RUN: rm -f %t2-i386.a %t2-x86_64.a %t2-ppc64.a +# RUN: rm -f %t2-i386.a %t2-x86_64.a %t2-ppc64.a %t2-ppc64le.a # RUN: llvm-ar rc %t2-i386.a %t2-i386.o # RUN: llvm-ar rc %t2-x86_64.a %t2-x86_64.o # RUN: llvm-ar rc %t2-ppc64le.a %t2-ppc64le.o Index: test/ELF/incompatible-ar-first.s =================================================================== --- test/ELF/incompatible-ar-first.s +++ test/ELF/incompatible-ar-first.s @@ -1,5 +1,6 @@ // REQUIRES: x86 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/archive.s -o %ta.o +// RUN: rm -f %t.a // RUN: llvm-ar rc %t.a %ta.o // RUN: llvm-mc -filetype=obj -triple=i686-linux %s -o %tb.o // RUN: not ld.lld %t.a %tb.o -o /dev/null 2>&1 | FileCheck %s Index: test/ELF/incompatible.s =================================================================== --- test/ELF/incompatible.s +++ test/ELF/incompatible.s @@ -48,6 +48,7 @@ // We used to fail to identify this incompatibility and crash trying to // read a 64 bit file as a 32 bit one. // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/archive2.s -o %ta.o +// RUN: rm -f %t.a // RUN: llvm-ar rc %t.a %ta.o // RUN: llvm-mc -filetype=obj -triple=i686-linux %s -o %tb.o // RUN: not ld.lld %t.a %tb.o 2>&1 -o %t | FileCheck --check-prefix=ARCHIVE %s Index: test/ELF/linkerscript/filename-spec.s =================================================================== --- test/ELF/linkerscript/filename-spec.s +++ test/ELF/linkerscript/filename-spec.s @@ -43,6 +43,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.testdir1/filename-spec1.o # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \ # RUN: %p/Inputs/filename-spec.s -o %t.testdir2/filename-spec2.o +# RUN: rm -f %t.testdir1/lib1.a %t.testdir2/lib2.a # RUN: llvm-ar rsc %t.testdir1/lib1.a %t.testdir1/filename-spec1.o # RUN: llvm-ar rsc %t.testdir2/lib2.a %t.testdir2/filename-spec2.o Index: test/ELF/linkerscript/lazy-symbols.test =================================================================== --- test/ELF/linkerscript/lazy-symbols.test +++ test/ELF/linkerscript/lazy-symbols.test @@ -1,5 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/lazy-symbols.s -o %t1 +# RUN: rm -f %tar # RUN: llvm-ar rcs %tar %t1 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux /dev/null -o %t2 # RUN: ld.lld %t2 %tar --script %s -o %tout Index: test/ELF/no-obj.s =================================================================== --- test/ELF/no-obj.s +++ test/ELF/no-obj.s @@ -1,5 +1,6 @@ // REQUIRES: x86 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +// RUN: rm -f %t.a // RUN: llvm-ar rcs %t.a %t.o // RUN: not ld.lld -o /dev/null -u _start %t.a 2>&1 | FileCheck %s Index: test/ELF/tls-in-archive.s =================================================================== --- test/ELF/tls-in-archive.s +++ test/ELF/tls-in-archive.s @@ -1,5 +1,6 @@ // REQUIRES: x86 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/tls-in-archive.s -o %t1.o +// RUN: rm -f %t.a // RUN: llvm-ar cru %t.a %t1.o // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t2.o // RUN: ld.lld %t2.o %t.a -o /dev/null Index: test/ELF/tls-weak-undef.s =================================================================== --- test/ELF/tls-weak-undef.s +++ test/ELF/tls-weak-undef.s @@ -4,6 +4,7 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux \ // RUN: %p/Inputs/tls-in-archive.s -o %t1.o +// RUN: rm -f %t.a // RUN: llvm-ar cru %t.a %t1.o // RUN: ld.lld %t.o %t.a -o %t Index: test/ELF/trace-ar.s =================================================================== --- test/ELF/trace-ar.s +++ test/ELF/trace-ar.s @@ -2,6 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/trace-ar1.s -o %t.obj1.o # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/trace-ar2.s -o %t.obj2.o +# RUN: rm -f %t.boo.a # RUN: llvm-ar rcs %t.boo.a %t.obj1.o %t.obj2.o ## Check how -t works with achieves Index: test/ELF/trace-symbols.s =================================================================== --- test/ELF/trace-symbols.s +++ test/ELF/trace-symbols.s @@ -8,7 +8,9 @@ # RUN: %p/Inputs/trace-symbols-foo-strong.s -o %t2 # RUN: ld.lld -shared %t1 -o %t1.so # RUN: ld.lld -shared %t2 -o %t2.so +# RUN: rm -f %t1.a # RUN: llvm-ar rcs %t1.a %t1 +# RUN: rm -f %t2.a # RUN: llvm-ar rcs %t2.a %t2 # RUN: ld.lld -y foo -trace-symbol common -trace-symbol=hsymbol \ Index: test/ELF/undef.s =================================================================== --- test/ELF/undef.s +++ test/ELF/undef.s @@ -3,6 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/undef.s -o %t2.o # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/undef-debug.s -o %t3.o # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/undef-bad-debug.s -o %t4.o +# RUN: rm -f %t2.a # RUN: llvm-ar rc %t2.a %t2.o # RUN: not ld.lld %t.o %t2.a %t3.o %t4.o -o %t.exe 2>&1 | FileCheck %s # RUN: not ld.lld -pie %t.o %t2.a %t3.o %t4.o -o %t.exe 2>&1 | FileCheck %s Index: test/ELF/version-exclude-libs.s =================================================================== --- test/ELF/version-exclude-libs.s +++ test/ELF/version-exclude-libs.s @@ -1,5 +1,6 @@ // REQUIRES: x86 // RUN: llvm-mc %p/Inputs/versiondef.s -o %t.o -filetype=obj -triple=x86_64-pc-linux +// RUN: rm -f %t.a // RUN: llvm-ar -r %t.a %t.o // RUN: llvm-mc %s -o %t2.o -filetype=obj -triple=x86_64-pc-linux // RUN: ld.lld %t2.o %t.a --shared --exclude-libs ALL -o %t.so Index: test/wasm/archive.ll =================================================================== --- test/wasm/archive.ll +++ test/wasm/archive.ll @@ -3,6 +3,7 @@ ; RUN: llc -filetype=obj %S/Inputs/archive2.ll -o %t.a2.o ; RUN: llc -filetype=obj %S/Inputs/archive3.ll -o %t.a3.o ; RUN: llc -filetype=obj %S/Inputs/hello.ll -o %t.hello.o +; RUN: rm -f %t.a ; RUN: llvm-ar rcs %t.a %t.a1.o %t.a2.o %t.a3.o %t.hello.o ; RUN: rm -f %t.imports ; RUN: not wasm-ld %t.a %t.o -o %t.wasm 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED %s Index: test/wasm/load-undefined.test =================================================================== --- test/wasm/load-undefined.test +++ test/wasm/load-undefined.test @@ -4,6 +4,7 @@ ; RUN: llc -filetype=obj %S/Inputs/ret64.ll -o %t.o ; RUN: llc -filetype=obj %S/Inputs/ret32.ll -o %t2.o ; RUN: llc -filetype=obj %S/Inputs/start.ll -o %t.start.o +; RUN: rm -f %t2.a ; RUN: llvm-ar rcs %t2.a %t2.o ; RUN: wasm-ld %t.start.o --no-gc-sections %t2.a %t.o -o %t.wasm -u ret32 --undefined ret64 ; RUN: obj2yaml %t.wasm | FileCheck %s Index: test/wasm/visibility-hidden.ll =================================================================== --- test/wasm/visibility-hidden.ll +++ test/wasm/visibility-hidden.ll @@ -1,5 +1,6 @@ ; RUN: llc -filetype=obj -o %t.o %s ; RUN: llc -filetype=obj %S/Inputs/hidden.ll -o %t2.o +; RUN: rm -f %t2.a ; RUN: llvm-ar rcs %t2.a %t2.o ; RUN: wasm-ld %t.o %t2.a -o %t.wasm ; RUN: obj2yaml %t.wasm | FileCheck %s