Skip to content

[lld] Remove usage of %T in lld/test #126133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 10, 2025
Merged

Conversation

DataCorrupted
Copy link
Member

%T is not unique and deprecated [1].

This patch replaces all %T in lld/test with %t.dir (mkdir if necessary)

@llvmbot
Copy link
Member

llvmbot commented Feb 6, 2025

@llvm/pr-subscribers-lld-coff
@llvm/pr-subscribers-lld-macho

@llvm/pr-subscribers-lld

Author: Peter Rong (DataCorrupted)

Changes

%T is not unique and deprecated [1].

This patch replaces all %T in lld/test with %t.dir (mkdir if necessary)


Patch is 47.70 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/126133.diff

22 Files Affected:

  • (modified) lld/test/COFF/delayimporttables.yaml (+3-2)
  • (modified) lld/test/COFF/export-all.s (+9-9)
  • (modified) lld/test/COFF/filename-casing.s (+5-4)
  • (modified) lld/test/COFF/guardcf-align.s (+5-4)
  • (modified) lld/test/COFF/implib-name.test (+25-25)
  • (modified) lld/test/COFF/locally-imported-warn-multiple.s (+5-4)
  • (modified) lld/test/COFF/lto-chkstk.ll (+5-4)
  • (modified) lld/test/COFF/lto-comdat.ll (+29-28)
  • (modified) lld/test/COFF/lto-lazy-reference.ll (+4-3)
  • (modified) lld/test/COFF/lto-linker-opts.ll (+3-2)
  • (modified) lld/test/COFF/lto.ll (+27-26)
  • (modified) lld/test/COFF/map.test (+5-4)
  • (modified) lld/test/COFF/out.test (+9-9)
  • (modified) lld/test/COFF/precomp-link.test (+4-3)
  • (modified) lld/test/COFF/savetemps-colon.ll (+30-30)
  • (modified) lld/test/COFF/savetemps.ll (+17-17)
  • (modified) lld/test/COFF/thinlto-archives.ll (+11-11)
  • (modified) lld/test/COFF/thinlto-mangled.ll (+2-2)
  • (modified) lld/test/COFF/thinlto-whole-archives.ll (+10-10)
  • (modified) lld/test/COFF/thinlto.ll (+15-15)
  • (modified) lld/test/MachO/objc-category-merging-erase-objc-name-test.s (+5-3)
  • (modified) lld/test/wasm/shared-weak-undefined.s (+4-3)
diff --git a/lld/test/COFF/delayimporttables.yaml b/lld/test/COFF/delayimporttables.yaml
index f1e7c61f55a5efe..cf54c0a7140a16b 100644
--- a/lld/test/COFF/delayimporttables.yaml
+++ b/lld/test/COFF/delayimporttables.yaml
@@ -1,8 +1,9 @@
 # RUN: yaml2obj %p/Inputs/delayimporttables-dll1.yaml -o %t1.obj
 # RUN: yaml2obj %p/Inputs/delayimporttables-dll2.yaml -o %t2.obj
 # RUN: yaml2obj %s -o %t.obj
-# RUN: lld-link /nodefaultlib /entry:DllMain /out:%T/delayimporttables-dll1.dll /dll /implib:%t-dll1.lib %t1.obj
-# RUN: lld-link /nodefaultlib /entry:DllMain /out:%T/delayimporttables-dll2.dll /dll /implib:%t-dll2.lib %t2.obj
+# RUN: mkdir -p %t.dir
+# RUN: lld-link /nodefaultlib /entry:DllMain /out:%t.dir/delayimporttables-dll1.dll /dll /implib:%t-dll1.lib %t1.obj
+# RUN: lld-link /nodefaultlib /entry:DllMain /out:%t.dir/delayimporttables-dll2.dll /dll /implib:%t-dll2.lib %t2.obj
 # RUN: lld-link /nodefaultlib /entry:main /out:%t.exe /delayload:delayimporttables-dll1.dll /delayload:delayimporttables-dll2.dll %t.obj %t-dll1.lib %t-dll2.lib
 # RUN: llvm-readobj --coff-imports %t.exe |FileCheck %s
 
diff --git a/lld/test/COFF/export-all.s b/lld/test/COFF/export-all.s
index a932bf0bba427ac..cd0a6f5f7b35a43 100644
--- a/lld/test/COFF/export-all.s
+++ b/lld/test/COFF/export-all.s
@@ -81,14 +81,14 @@ __imp__unexported:
 
 # RUN: echo -e ".global foobar\n.global DllMainCRTStartup\n.text\nDllMainCRTStartup:\nret\nfoobar:\ncall mingwfunc\ncall crtfunc\nret\n" > %t.main.s
 # RUN: llvm-mc -triple=x86_64-windows-gnu %t.main.s -filetype=obj -o %t.main.obj
-# 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
-# RUN: lld-link -safeseh:no -out:%t.dll -dll -entry:DllMainCRTStartup %t.main.obj -lldmingw %T/libs/crt2.o %T/libs/libmingwex.a -output-def:%t.def
+# RUN: mkdir -p %t.dir/libs
+# RUN: echo -e ".global mingwfunc\n.text\nmingwfunc:\nret\n" > %t.dir/libs/mingwfunc.s
+# RUN: llvm-mc -triple=x86_64-windows-gnu %t.dir/libs/mingwfunc.s -filetype=obj -o %t.dir/libs/mingwfunc.o
+# RUN: rm -f %t.dir/libs/libmingwex.a
+# RUN: llvm-ar rcs %t.dir/libs/libmingwex.a %t.dir/libs/mingwfunc.o
+# RUN: echo -e ".global crtfunc\n.text\ncrtfunc:\nret\n" > %t.dir/libs/crtfunc.s
+# RUN: llvm-mc -triple=x86_64-windows-gnu %t.dir/libs/crtfunc.s -filetype=obj -o %t.dir/libs/crt2.o
+# RUN: lld-link -safeseh:no -out:%t.dll -dll -entry:DllMainCRTStartup %t.main.obj -lldmingw %t.dir/libs/crt2.o %t.dir/libs/libmingwex.a -output-def:%t.def
 # RUN: echo "EOF" >> %t.def
 # RUN: cat %t.def | FileCheck -check-prefix=CHECK-EXCLUDE %s
 
@@ -99,7 +99,7 @@ __imp__unexported:
 # Test that libraries included with -wholearchive: are autoexported, even if
 # they are in a library that otherwise normally would be excluded.
 
-# RUN: lld-link -safeseh:no -out:%t.dll -dll -entry:DllMainCRTStartup %t.main.obj -lldmingw %T/libs/crt2.o -wholearchive:%T/libs/libmingwex.a -output-def:%t.def
+# RUN: lld-link -safeseh:no -out:%t.dll -dll -entry:DllMainCRTStartup %t.main.obj -lldmingw %t.dir/libs/crt2.o -wholearchive:%t.dir/libs/libmingwex.a -output-def:%t.def
 # RUN: echo "EOF" >> %t.def
 # RUN: cat %t.def | FileCheck -check-prefix=CHECK-WHOLEARCHIVE %s
 
diff --git a/lld/test/COFF/filename-casing.s b/lld/test/COFF/filename-casing.s
index 0834c034ee74f26..46819fb282edf81 100644
--- a/lld/test/COFF/filename-casing.s
+++ b/lld/test/COFF/filename-casing.s
@@ -1,10 +1,11 @@
 # REQUIRES: x86
 
-# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %T/MixedCase.obj %s
-# RUN: not lld-link /entry:main %T/MixedCase.obj 2>&1 | FileCheck -check-prefix=OBJECT %s
+# RUN: mkdir -p %t.dir
+# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %t.dir/MixedCase.obj %s
+# RUN: not lld-link /entry:main %t.dir/MixedCase.obj 2>&1 | FileCheck -check-prefix=OBJECT %s
 
-# RUN: llvm-lib /out:%T/MixedCase.lib %T/MixedCase.obj
-# RUN: not lld-link /machine:x64 /entry:main %T/MixedCase.lib 2>&1 | FileCheck -check-prefix=ARCHIVE %s
+# RUN: llvm-lib /out:%t.dir/MixedCase.lib %t.dir/MixedCase.obj
+# RUN: not lld-link /machine:x64 /entry:main %t.dir/MixedCase.lib 2>&1 | FileCheck -check-prefix=ARCHIVE %s
 
 # OBJECT: undefined symbol: f
 # OBJECT-NEXT: >>> referenced by {{.*}}MixedCase.obj:(main)
diff --git a/lld/test/COFF/guardcf-align.s b/lld/test/COFF/guardcf-align.s
index 0535dc8ac3d8976..f70fd0a82c0028b 100644
--- a/lld/test/COFF/guardcf-align.s
+++ b/lld/test/COFF/guardcf-align.s
@@ -1,10 +1,11 @@
 # REQUIRES: x86
+# RUN: mkdir -p %t.dir
 # RUN: llvm-mc -triple x86_64-windows-msvc -filetype=obj -o %t.obj %s
 # RUN: yaml2obj %p/Inputs/guardcf-align-foobar.yaml \
-# RUN:     > %T/guardcf-align-foobar.obj
-# RUN: lld-link -out:%T/guardcf-align.exe -entry:main -guard:cf \
-# RUN:     %t.obj %T/guardcf-align-foobar.obj
-# RUN: llvm-readobj --coff-load-config %T/guardcf-align.exe | FileCheck %s
+# RUN:     > %t.dir/guardcf-align-foobar.obj
+# RUN: lld-link -out:%t.dir/guardcf-align.exe -entry:main -guard:cf \
+# RUN:     %t.obj %t.dir/guardcf-align-foobar.obj
+# RUN: llvm-readobj --coff-load-config %t.dir/guardcf-align.exe | FileCheck %s
 
 # Check that the gfids table contains at least one entry that ends in 0
 # and no entries that end in something other than 0.
diff --git a/lld/test/COFF/implib-name.test b/lld/test/COFF/implib-name.test
index 3ec8d823a91da15..ffb74d7c53c5bdf 100644
--- a/lld/test/COFF/implib-name.test
+++ b/lld/test/COFF/implib-name.test
@@ -1,73 +1,73 @@
 # REQUIRES: x86
-# RUN: mkdir -p %T
-# RUN: llvm-mc -triple x86_64-unknown-windows-msvc -filetype obj -o %T/object.obj %S/Inputs/object.s
+# RUN: mkdir -p %t.dir
+# RUN: llvm-mc -triple x86_64-unknown-windows-msvc -filetype obj -o %t.dir/object.obj %S/Inputs/object.s
 
-# RUN: lld-link /dll /machine:x64 /def:%S/Inputs/named.def /out:%T/library.dll %T/object.obj /entry:f /subsystem:CONSOLE
-# RUN: llvm-ar t %T/library.lib | FileCheck %s -check-prefix CHECK-DEFAULT-DLL-EXT
+# RUN: lld-link /dll /machine:x64 /def:%S/Inputs/named.def /out:%t.dir/library.dll %t.dir/object.obj /entry:f /subsystem:CONSOLE
+# RUN: llvm-ar t %t.dir/library.lib | FileCheck %s -check-prefix CHECK-DEFAULT-DLL-EXT
 
-# RUN: lld-link /machine:x64 /def:%S/Inputs/named.def /out:%T/library.lib
-# RUN: llvm-ar t %T/library.lib | FileCheck %s -check-prefix CHECK-DEFAULT-DLL-EXT
+# RUN: lld-link /machine:x64 /def:%S/Inputs/named.def /out:%t.dir/library.lib
+# RUN: llvm-ar t %t.dir/library.lib | FileCheck %s -check-prefix CHECK-DEFAULT-DLL-EXT
 
 CHECK-DEFAULT-DLL-EXT: library.dll
 CHECK-DEFAULT-DLL-EXT: library.dll
 CHECK-DEFAULT-DLL-EXT: library.dll
 CHECK-DEFAULT-DLL-EXT: library.dll
 
-# RUN: lld-link /machine:x64 /def:%S/Inputs/named.def /out:%T/library.exe %T/object.obj /entry:f /subsystem:CONSOLE
-# RUN: llvm-ar t %T/library.lib | FileCheck %s -check-prefix CHECK-DEFAULT-EXE-EXT
+# RUN: lld-link /machine:x64 /def:%S/Inputs/named.def /out:%t.dir/library.exe %t.dir/object.obj /entry:f /subsystem:CONSOLE
+# RUN: llvm-ar t %t.dir/library.lib | FileCheck %s -check-prefix CHECK-DEFAULT-EXE-EXT
 
 CHECK-DEFAULT-EXE-EXT: library.exe
 CHECK-DEFAULT-EXE-EXT: library.exe
 CHECK-DEFAULT-EXE-EXT: library.exe
 CHECK-DEFAULT-EXE-EXT: library.exe
 
-# RUN: lld-link /dll /machine:x64 /def:%S/Inputs/extension.def /out:%T/extension.dll /entry:f /subsystem:CONSOLE
-# RUN: llvm-ar t %T/extension.lib | FileCheck %s -check-prefix CHECK-EXTENSION
+# RUN: lld-link /dll /machine:x64 /def:%S/Inputs/extension.def /out:%t.dir/extension.dll /entry:f /subsystem:CONSOLE
+# RUN: llvm-ar t %t.dir/extension.lib | FileCheck %s -check-prefix CHECK-EXTENSION
 
-# RUN: lld-link /machine:x64 /def:%S/Inputs/extension.def /out:%T/extension.exe /entry:f /subsystem:CONSOLE
-# RUN: llvm-ar t %T/extension.lib | FileCheck %s -check-prefix CHECK-EXTENSION
+# RUN: lld-link /machine:x64 /def:%S/Inputs/extension.def /out:%t.dir/extension.exe /entry:f /subsystem:CONSOLE
+# RUN: llvm-ar t %t.dir/extension.lib | FileCheck %s -check-prefix CHECK-EXTENSION
 
-# RUN: lld-link /machine:x64 /def:%S/Inputs/extension.def /out:%T/extension.lib
-# RUN: llvm-ar t %T/extension.lib | FileCheck %s -check-prefix CHECK-EXTENSION
+# RUN: lld-link /machine:x64 /def:%S/Inputs/extension.def /out:%t.dir/extension.lib
+# RUN: llvm-ar t %t.dir/extension.lib | FileCheck %s -check-prefix CHECK-EXTENSION
 
 CHECK-EXTENSION: library.ext
 CHECK-EXTENSION: library.ext
 CHECK-EXTENSION: library.ext
 CHECK-EXTENSION: library.ext
 
-# RUN: lld-link /dll /machine:x64 /def:%S/Inputs/default.def /out:%T/default.dll /entry:f /subsystem:CONSOLE
-# RUN: llvm-ar t %T/default.lib | FileCheck %s -check-prefix CHECK-OUTPUT-NAME-DLL
+# RUN: lld-link /dll /machine:x64 /def:%S/Inputs/default.def /out:%t.dir/default.dll /entry:f /subsystem:CONSOLE
+# RUN: llvm-ar t %t.dir/default.lib | FileCheck %s -check-prefix CHECK-OUTPUT-NAME-DLL
 
-# RUN: lld-link /machine:x64 /def:%S/Inputs/default.def /out:%T/default.lib
-# RUN: llvm-ar t %T/default.lib | FileCheck %s -check-prefix CHECK-OUTPUT-NAME-DLL
+# RUN: lld-link /machine:x64 /def:%S/Inputs/default.def /out:%t.dir/default.lib
+# RUN: llvm-ar t %t.dir/default.lib | FileCheck %s -check-prefix CHECK-OUTPUT-NAME-DLL
 
 CHECK-OUTPUT-NAME-DLL: default.dll
 CHECK-OUTPUT-NAME-DLL: default.dll
 CHECK-OUTPUT-NAME-DLL: default.dll
 CHECK-OUTPUT-NAME-DLL: default.dll
 
-# RUN: lld-link /machine:x64 /def:%S/Inputs/default.def /out:%T/default.exe %T/object.obj /entry:f /subsystem:CONSOLE
-# RUN: llvm-ar t %T/default.lib | FileCheck %s -check-prefix CHECK-OUTPUT-NAME-EXE
+# RUN: lld-link /machine:x64 /def:%S/Inputs/default.def /out:%t.dir/default.exe %t.dir/object.obj /entry:f /subsystem:CONSOLE
+# RUN: llvm-ar t %t.dir/default.lib | FileCheck %s -check-prefix CHECK-OUTPUT-NAME-EXE
 
 CHECK-OUTPUT-NAME-EXE: default.exe
 CHECK-OUTPUT-NAME-EXE: default.exe
 CHECK-OUTPUT-NAME-EXE: default.exe
 CHECK-OUTPUT-NAME-EXE: default.exe
 
-# RUN: lld-link /machine:x64 /out:%T/default.exe %T/object.obj /entry:f /subsystem:CONSOLE
-# RUN: llvm-ar t %T/default.lib | FileCheck %s -check-prefix CHECK-NODEF-EXE
+# RUN: lld-link /machine:x64 /out:%t.dir/default.exe %t.dir/object.obj /entry:f /subsystem:CONSOLE
+# RUN: llvm-ar t %t.dir/default.lib | FileCheck %s -check-prefix CHECK-NODEF-EXE
 
 CHECK-NODEF-EXE: default.exe
 CHECK-NODEF-EXE: default.exe
 CHECK-NODEF-EXE: default.exe
 CHECK-NODEF-EXE: default.exe
 
-# RUN: lld-link /machine:x64 /dll /out:%T/default.dll %T/object.obj /entry:f /subsystem:CONSOLE
-# RUN: llvm-ar t %T/default.lib | FileCheck %s -check-prefix CHECK-NODEF-DLL
+# RUN: lld-link /machine:x64 /dll /out:%t.dir/default.dll %t.dir/object.obj /entry:f /subsystem:CONSOLE
+# RUN: llvm-ar t %t.dir/default.lib | FileCheck %s -check-prefix CHECK-NODEF-DLL
 
 CHECK-NODEF-DLL: default.dll
 CHECK-NODEF-DLL: default.dll
 CHECK-NODEF-DLL: default.dll
 CHECK-NODEF-DLL: default.dll
 
-# RUN: lld-link /nologo /machine:x64 /out:%T/exe %T/object.obj /entry:f /subsystem:CONSOLE
+# RUN: lld-link /nologo /machine:x64 /out:%t.dir/exe %t.dir/object.obj /entry:f /subsystem:CONSOLE
diff --git a/lld/test/COFF/locally-imported-warn-multiple.s b/lld/test/COFF/locally-imported-warn-multiple.s
index 247ec58b0fdb634..f1d03415eb90d28 100644
--- a/lld/test/COFF/locally-imported-warn-multiple.s
+++ b/lld/test/COFF/locally-imported-warn-multiple.s
@@ -1,10 +1,11 @@
 # REQUIRES: x86
 
-# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %T/locally-imported-def.obj %S/Inputs/locally-imported-def.s
-# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %T/locally-imported-imp1.obj %S/Inputs/locally-imported-imp.s
-# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %T/locally-imported-imp2.obj %S/Inputs/locally-imported-imp.s
+# RUN: mkdir -p %t.dir
+# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %t.dir/locally-imported-def.obj %S/Inputs/locally-imported-def.s
+# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %t.dir/locally-imported-imp1.obj %S/Inputs/locally-imported-imp.s
+# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %t.dir/locally-imported-imp2.obj %S/Inputs/locally-imported-imp.s
 # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %t.obj %s
-# RUN: lld-link /entry:main %T/locally-imported-def.obj %T/locally-imported-imp1.obj %T/locally-imported-imp2.obj %t.obj 2>&1 | FileCheck %s
+# RUN: lld-link /entry:main %t.dir/locally-imported-def.obj %t.dir/locally-imported-imp1.obj %t.dir/locally-imported-imp2.obj %t.obj 2>&1 | FileCheck %s
 
 # CHECK: warning: [[TESTDIR:.+]]locally-imported-imp1.obj: locally defined symbol imported: f (defined in [[TESTDIR]]locally-imported-def.obj)
 # CHECK-NEXT: warning: [[TESTDIR:.+]]locally-imported-imp2.obj: locally defined symbol imported: f (defined in [[TESTDIR]]locally-imported-def.obj)
diff --git a/lld/test/COFF/lto-chkstk.ll b/lld/test/COFF/lto-chkstk.ll
index 331acea92c3ab29..8703983cd519e95 100644
--- a/lld/test/COFF/lto-chkstk.ll
+++ b/lld/test/COFF/lto-chkstk.ll
@@ -1,10 +1,11 @@
 ; REQUIRES: x86
+; RUN: mkdir -p %t.dir
 ; 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: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t.dir/lto-chkstk-foo.obj %S/Inputs/lto-chkstk-foo.s
+; RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t.dir/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
+; RUN: llvm-ar cru %t.lib %t.dir/lto-chkstk-chkstk.obj
+; RUN: lld-link /out:%t.exe /entry:main /subsystem:console %t.obj %t.dir/lto-chkstk-foo.obj %t.lib
 
 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc"
diff --git a/lld/test/COFF/lto-comdat.ll b/lld/test/COFF/lto-comdat.ll
index 52e34b16350639d..76ef8259695a570 100644
--- a/lld/test/COFF/lto-comdat.ll
+++ b/lld/test/COFF/lto-comdat.ll
@@ -1,44 +1,45 @@
 ; REQUIRES: x86
-; RUN: llvm-as -o %T/comdat-main.lto.obj %s
-; RUN: llvm-as -o %T/comdat1.lto.obj %S/Inputs/lto-comdat1.ll
-; RUN: llvm-as -o %T/comdat2.lto.obj %S/Inputs/lto-comdat2.ll
-; RUN: rm -f %T/comdat.lto.lib
-; RUN: llvm-ar cru %T/comdat.lto.lib %T/comdat1.lto.obj %T/comdat2.lto.obj
+; RUN: mkdir -p %t.dir
+; RUN: llvm-as -o %t.dir/comdat-main.lto.obj %s
+; RUN: llvm-as -o %t.dir/comdat1.lto.obj %S/Inputs/lto-comdat1.ll
+; RUN: llvm-as -o %t.dir/comdat2.lto.obj %S/Inputs/lto-comdat2.ll
+; RUN: rm -f %t.dir/comdat.lto.lib
+; RUN: llvm-ar cru %t.dir/comdat.lto.lib %t.dir/comdat1.lto.obj %t.dir/comdat2.lto.obj
 
-; RUN: llc -filetype=obj -o %T/comdat-main.obj %s
-; RUN: llc -filetype=obj -o %T/comdat1.obj %S/Inputs/lto-comdat1.ll
-; RUN: llc -filetype=obj -o %T/comdat2.obj %S/Inputs/lto-comdat2.ll
-; RUN: rm -f %T/comdat.lib
-; RUN: llvm-ar cru %T/comdat.lib %T/comdat1.obj %T/comdat2.obj
+; RUN: llc -filetype=obj -o %t.dir/comdat-main.obj %s
+; RUN: llc -filetype=obj -o %t.dir/comdat1.obj %S/Inputs/lto-comdat1.ll
+; RUN: llc -filetype=obj -o %t.dir/comdat2.obj %S/Inputs/lto-comdat2.ll
+; RUN: rm -f %t.dir/comdat.lib
+; RUN: llvm-ar cru %t.dir/comdat.lib %t.dir/comdat1.obj %t.dir/comdat2.obj
 
 ; Check that, when we use an LTO main with LTO objects, we optimize away all
 ; of f1, f2, and comdat.
-; RUN: lld-link /out:%T/comdat-main.exe /entry:main /subsystem:console %T/comdat-main.lto.obj %T/comdat1.lto.obj %T/comdat2.lto.obj
-; RUN: llvm-readobj --file-headers %T/comdat-main.exe | FileCheck -check-prefix=HEADERS-11 %s
-; RUN: llvm-objdump --no-print-imm-hex -d %T/comdat-main.exe | FileCheck --check-prefix=TEXT-11 %s
-; RUN: lld-link /out:%T/comdat-main.exe /entry:main /subsystem:console %T/comdat-main.lto.obj %T/comdat.lto.lib
-; RUN: llvm-readobj --file-headers %T/comdat-main.exe | FileCheck -check-prefix=HEADERS-11 %s
-; RUN: llvm-objdump --no-print-imm-hex -d %T/comdat-main.exe | FileCheck --check-prefix=TEXT-11 %s
+; RUN: lld-link /out:%t.dir/comdat-main.exe /entry:main /subsystem:console %t.dir/comdat-main.lto.obj %t.dir/comdat1.lto.obj %t.dir/comdat2.lto.obj
+; RUN: llvm-readobj --file-headers %t.dir/comdat-main.exe | FileCheck -check-prefix=HEADERS-11 %s
+; RUN: llvm-objdump --no-print-imm-hex -d %t.dir/comdat-main.exe | FileCheck --check-prefix=TEXT-11 %s
+; RUN: lld-link /out:%t.dir/comdat-main.exe /entry:main /subsystem:console %t.dir/comdat-main.lto.obj %t.dir/comdat.lto.lib
+; RUN: llvm-readobj --file-headers %t.dir/comdat-main.exe | FileCheck -check-prefix=HEADERS-11 %s
+; RUN: llvm-objdump --no-print-imm-hex -d %t.dir/comdat-main.exe | FileCheck --check-prefix=TEXT-11 %s
 
 ; Check that, when we use a non-LTO main with LTO objects, we pick the comdat
 ; implementation in LTO, elide calls to it from inside LTO, and retain the
 ; call to comdat from main.
-; RUN: lld-link /out:%T/comdat-main.exe /entry:main /subsystem:console %T/comdat-main.obj %T/comdat1.lto.obj %T/comdat2.lto.obj
-; RUN: llvm-readobj --file-headers %T/comdat-main.exe | FileCheck -check-prefix=HEADERS-01 %s
-; RUN: llvm-objdump --no-print-imm-hex -d %T/comdat-main.exe | FileCheck --check-prefix=TEXT-01 %s
-; RUN: lld-link /out:%T/comdat-main.exe /entry:main /subsystem:console %T/comdat-main.obj %T/comdat.lto.lib
-; RUN: llvm-readobj --file-headers %T/comdat-main.exe | FileCheck -check-prefix=HEADERS-01 %s
-; RUN: llvm-objdump --no-print-imm-hex -d %T/comdat-main.exe | FileCheck --check-prefix=TEXT-01 %s
+; RUN: lld-link /out:%t.dir/comdat-main.exe /entry:main /subsystem:console %t.dir/comdat-main.obj %t.dir/comdat1.lto.obj %t.dir/comdat2.lto.obj
+; RUN: llvm-readobj --file-headers %t.dir/comdat-main.exe | FileCheck -check-prefix=HEADERS-01 %s
+; RUN: llvm-objdump --no-print-imm-hex -d %t.dir/comdat-main.exe | FileCheck --check-prefix=TEXT-01 %s
+; RUN: lld-link /out:%t.dir/comdat-main.exe /entry:main /subsystem:console %t.dir/comdat-main.obj %t.dir/comdat.lto.lib
+; RUN: llvm-readobj --file-headers %t.dir/comdat-main.exe | FileCheck -check-prefix=HEADERS-01 %s
+; RUN: llvm-objdump --no-print-imm-hex -d %t.dir/comdat-main.exe | FileCheck --check-prefix=TEXT-01 %s
 
 ; Check that, when we use an LTO main with non-LTO objects, we pick the comdat
 ; implementation in LTO, elide the call to it from inside LTO, and keep the
 ; calls to comdat from the non-LTO objects.
-; RUN: lld-link /out:%T/comdat-main.exe /entry:main /subsystem:console %T/comdat-main.lto.obj %T/comdat1.obj %T/comdat2.obj
-; RUN: llvm-readobj --file-headers %T/comdat-main.exe | FileCheck -check-prefix=HEADERS-10 %s
-; RUN: llvm-objdump --no-print-imm-hex -d %T/comdat-main.exe | FileCheck --check-prefix=TEXT-10 %s
-; RUN: lld-link /out:%T/comdat-main.exe /entry:main /subsystem:console %T/comdat-main.lto.obj %T/comdat.lib
-; RUN: llvm-readobj --file-headers %T/comdat-main.exe | FileCheck -check-prefix=HEADERS-10 %s
-; RUN: llvm-objdump --no-print-imm-hex -d %T/comdat-main.exe | FileCheck --check-prefix=TEXT-10 %s
+; RUN: lld-link /out:%t.dir/comdat-main.exe /entry:main /subsystem:console %t.dir/comdat-main.lto.obj %t.dir/comdat1.obj %t.dir/comdat2.obj
+; RUN: llvm-readobj --file-headers %t.dir/comdat-main.exe | FileCheck -check-prefix=HEADERS-10 %s
+; RUN: llvm-objdump --no-print-imm-hex -d %t.dir/comdat-main.exe | FileCheck --check-prefix=TEXT-10 %s
+; RUN: lld-link /out:%t.dir/comdat-main.exe /entry:main /subsystem:console %t.dir/comdat-main.lto.obj %t.dir/comdat.lib
+; RUN: llvm-readobj --file-headers %t.dir/comdat-main.exe | FileCheck -check-prefix=HEADERS-10 %s
+; RUN: llvm-objdump --no-print-imm-hex -d %t.dir/comdat-main.exe | FileCheck --check-prefix=TEXT-10 %s
 
 ; HEADERS-11: AddressOfEntryPoint: 0x1000
 ; TEXT-11: Disassembly of section .text:
diff --git a/lld/test/COFF/lto-lazy-reference.ll b/lld/test/COFF/lto-lazy-reference.ll
index a6f4010eddd5db4..49d61cad7a6f3d3 100644
--- a/lld/test/COFF/lto-lazy-reference.ll
+++ b/lld/test/COFF/lto-lazy-reference.ll
@@ -1,8 +1,9 @@
 ; REQUIRES: ...
[truncated]

@ellishg
Copy link
Contributor

ellishg commented Feb 6, 2025

The MachO test change looks good, but I am afraid of Windows tests because I've broken those builds several times before and they are a pain for me to test. Can folks familiar with Windows review? Or know who might own these tests?

@DataCorrupted DataCorrupted changed the title [lld] Remove usage of %T in lld [lld] Remove usage of %T in lld/test Feb 6, 2025
@alx32
Copy link
Contributor

alx32 commented Feb 6, 2025

Agree with @ellishg - tests look good - but "mkdir -p" might fail on Windows because of "-p" being unsupported. I guess we can wait for windows tests to run and see if they fail.

EDIT: Looks like Windows tests succeeded - LGTM.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasm test lgtm

@DataCorrupted DataCorrupted merged commit 839002d into llvm:main Feb 10, 2025
8 checks passed
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
`%T` is not unique and deprecated
[[1](https://llvm.org/docs/CommandGuide/lit.html#substitutions)].

This patch replaces all `%T` in `lld/test` with `%t.dir` (`mkdir` if
necessary)

---------

Signed-off-by: Peter Rong <[email protected]>
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
`%T` is not unique and deprecated
[[1](https://llvm.org/docs/CommandGuide/lit.html#substitutions)].

This patch replaces all `%T` in `lld/test` with `%t.dir` (`mkdir` if
necessary)

---------

Signed-off-by: Peter Rong <[email protected]>
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
`%T` is not unique and deprecated
[[1](https://llvm.org/docs/CommandGuide/lit.html#substitutions)].

This patch replaces all `%T` in `lld/test` with `%t.dir` (`mkdir` if
necessary)

---------

Signed-off-by: Peter Rong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants