Skip to content

Commit fab2d22

Browse files
boomanaiden154krishna2803
authored andcommitted
[lldb] Remove %T from lit tests (llvm#151343)
%T has been deprecated for about seven years, mostly because it is not unique to each test which can lead to races. This patch updates the few remaining tests in lldb that use %T to not use it (either directly using files or creating their own temp dir). The eventual goal is to remove support for %T from llvm-lit given few tests use it and it still has racey behavior. This patch errors on the side of creating new temp dirs even when not strictly necessary to avoid needing to update filenames inside filecheck matchers.
1 parent f98be2c commit fab2d22

31 files changed

+132
-106
lines changed

lldb/test/Shell/Commands/command-disassemble-process.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# REQUIRES: x86
22

3-
# RUN: yaml2obj --docnum=1 -DMAIN_SIZE=8 %s -o %T/command-disassemble-process.exe
4-
# RUN: yaml2obj --docnum=1 -DMAIN_SIZE=8000 %s -o %T/command-disassemble-process.big.exe
3+
# RUN: mkdir -p %t.dir
4+
# RUN: yaml2obj --docnum=1 -DMAIN_SIZE=8 %s -o %t.dir/command-disassemble-process.exe
5+
# RUN: yaml2obj --docnum=1 -DMAIN_SIZE=8000 %s -o %t.dir/command-disassemble-process.big.exe
56
# RUN: yaml2obj --docnum=2 %s -o %t
67

7-
# RUN: %lldb -c %t %T/command-disassemble-process.exe \
8+
# RUN: %lldb -c %t %t.dir/command-disassemble-process.exe \
89
# RUN: -o "settings set interpreter.stop-command-source-on-error false" \
910
# RUN: -s %S/Inputs/command-disassemble-process.lldbinit -o exit \
1011
# RUN: | FileCheck %s
1112

12-
# RUN: %lldb -c %t %T/command-disassemble-process.big.exe \
13+
# RUN: %lldb -c %t %t.dir/command-disassemble-process.big.exe \
1314
# RUN: -o "settings set stop-disassembly-max-size 8000" \
1415
# RUN: -o disassemble -o exit 2>&1 | FileCheck %s --check-prefix=BIG
1516

16-
# RUN: %lldb -c %t %T/command-disassemble-process.exe \
17+
# RUN: %lldb -c %t %t.dir/command-disassemble-process.exe \
1718
# RUN: -o "settings set interpreter.stop-command-source-on-error false" \
1819
# RUN: -o "disassemble --address 0xdead" -o exit 2>&1 \
1920
# RUN: | FileCheck %s --check-prefix=INVALID

lldb/test/Shell/Commands/command-image-lookup.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# RUN: yaml2obj %s -o %T/a.out
2-
# RUN: %lldb %T/a.out -o "image lookup --verbose --address 0x0000000100003fa1" -o exit | FileCheck %s --check-prefix=NOINLINE
3-
# RUN: %lldb %T/a.out -o "image lookup --verbose --address 0x0000000100003fa2" -o exit | FileCheck %s --check-prefix=INLINE_1
4-
# RUN: %lldb %T/a.out -o "image lookup --verbose --address 0x0000000100003fa8" -o exit | FileCheck %s --check-prefix=INLINE_2
1+
# RUN: mkdir -p %t.dir
2+
# RUN: yaml2obj %s -o %t.dir/a.out
3+
# RUN: %lldb %t.dir/a.out -o "image lookup --verbose --address 0x0000000100003fa1" -o exit | FileCheck %s --check-prefix=NOINLINE
4+
# RUN: %lldb %t.dir/a.out -o "image lookup --verbose --address 0x0000000100003fa2" -o exit | FileCheck %s --check-prefix=INLINE_1
5+
# RUN: %lldb %t.dir/a.out -o "image lookup --verbose --address 0x0000000100003fa8" -o exit | FileCheck %s --check-prefix=INLINE_2
56

67
# NOINLINE: Summary: a.out`main + 33 at main.cpp:10
78
# NOINLINE-NEXT: Module: file =

lldb/test/Shell/Minidump/Windows/arm-fp-unwind.test

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ Test that unwind plans use the frame pointer register correctly.
22

33
REQUIRES: arm
44

5-
RUN: yaml2obj %S/Inputs/arm-fp-unwind.exe.yaml -o %T/arm-fp-unwind.exe
6-
RUN: yaml2obj %S/Inputs/arm-fp-unwind.dmp.yaml -o %T/arm-fp-unwind.dmp
7-
RUN: %lldb -O "settings set target.exec-search-paths %T" \
8-
RUN: -c %T/arm-fp-unwind.dmp -o "image show-unwind -a 0x00c71010" -b \
5+
RUN: mkdir -p %t.dir
6+
RUN: yaml2obj %S/Inputs/arm-fp-unwind.exe.yaml -o %t.dir/arm-fp-unwind.exe
7+
RUN: yaml2obj %S/Inputs/arm-fp-unwind.dmp.yaml -o %t.dir/arm-fp-unwind.dmp
8+
RUN: %lldb -O "settings set target.exec-search-paths %t.dir" \
9+
RUN: -c %t.dir/arm-fp-unwind.dmp -o "image show-unwind -a 0x00c71010" -b \
910
RUN: | FileCheck %s
1011

1112
CHECK: Assembly language inspection UnwindPlan:
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Test that we can cope with broken unwind information that suggests
22
reading out of bounds.
33

4-
RUN: yaml2obj %S/Inputs/broken-unwind.exe.yaml -o %T/broken-unwind.exe
5-
RUN: yaml2obj %S/Inputs/broken-unwind.dmp.yaml -o %T/broken-unwind.dmp
6-
RUN: %lldb -O "settings set target.exec-search-paths %T" \
7-
RUN: -c %T/broken-unwind.dmp -o "image show-unwind -a 0xb1000" -o exit
4+
RUN: mkdir -p %t.dir
5+
RUN: yaml2obj %S/Inputs/broken-unwind.exe.yaml -o %t.dir/broken-unwind.exe
6+
RUN: yaml2obj %S/Inputs/broken-unwind.dmp.yaml -o %t.dir/broken-unwind.dmp
7+
RUN: %lldb -O "settings set target.exec-search-paths %t.dir" \
8+
RUN: -c %t.dir/broken-unwind.dmp -o "image show-unwind -a 0xb1000" -o exit

lldb/test/Shell/Minidump/Windows/find-module.test

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@ use it when opening minidumps.
33

44
XFAIL: system-windows && remote-linux
55

6-
RUN: yaml2obj %S/Inputs/find-module.exe.yaml -o %T/find-module.exe
7-
RUN: yaml2obj %S/Inputs/find-module.dmp.yaml -o %T/find-module.dmp
8-
RUN: %lldb -O "settings set target.exec-search-paths %T" \
9-
RUN: -c %T/find-module.dmp -o "image dump objfile" -o "target list" -o exit \
6+
RUN: mkdir -p %t.dir
7+
RUN: yaml2obj %S/Inputs/find-module.exe.yaml -o %t.dir/find-module.exe
8+
RUN: yaml2obj %S/Inputs/find-module.dmp.yaml -o %t.dir/find-module.dmp
9+
RUN: %lldb -O "settings set target.exec-search-paths %t.dir" \
10+
RUN: -c %t.dir/find-module.dmp -o "image dump objfile" -o "target list" -o exit \
1011
RUN: | FileCheck --check-prefix=DEFAULT %s
1112

1213
RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi msvc" \
13-
RUN: -O "settings set target.exec-search-paths %T" -c %T/find-module.dmp \
14+
RUN: -O "settings set target.exec-search-paths %t.dir" -c %t.dir/find-module.dmp \
1415
RUN: -o "target list" -o exit | FileCheck --check-prefix=MSVC %s
1516

1617
RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi gnu" \
17-
RUN: -O "settings set target.exec-search-paths %T" -c %T/find-module.dmp \
18+
RUN: -O "settings set target.exec-search-paths %t.dir" -c %t.dir/find-module.dmp \
1819
RUN: -o "target list" -o exit | FileCheck --check-prefix=GNU %s
1920

2021
DEFAULT-LABEL: image dump objfile

lldb/test/Shell/Minidump/memory-region-from-module.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
# RUN: yaml2obj --docnum=1 %s -o %t1.dmp
55
# RUN: yaml2obj --docnum=2 %s -o %t2.dmp
6-
# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %T/memory-region-from-module.exe
6+
# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %t.memory-region-from-module.exe
77

8-
# RUN: %lldb -b -c %t1.dmp %T/memory-region-from-module.exe \
8+
# RUN: %lldb -b -c %t1.dmp %t.memory-region-from-module.exe \
99
# RUN: -o "memory region 0" -o "memory region 0x4000" \
1010
# RUN: -o "memory region 0x5000" -o "memory region 0x6000" \
1111
# RUN: | FileCheck --check-prefix=ALL --check-prefix=CHECK1 %s
1212

13-
# RUN: %lldb -b -c %t2.dmp %T/memory-region-from-module.exe \
13+
# RUN: %lldb -b -c %t2.dmp %t.memory-region-from-module.exe \
1414
# RUN: -o "memory region 0" -o "memory region 0x4000" \
1515
# RUN: -o "memory region 0x5000" -o "memory region 0x6000" \
1616
# RUN: | FileCheck --check-prefix=ALL --check-prefix=CHECK2 %s

lldb/test/Shell/ObjectFile/Breakpad/uuid-matching-mac.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# RUN: yaml2obj %S/Inputs/uuid-matching-mac.yaml -o %T/uuid-matching-mac.out
1+
# RUN: mkdir -p %t.dir
2+
# RUN: yaml2obj %S/Inputs/uuid-matching-mac.yaml -o %t.dir/uuid-matching-mac.out
23
# RUN: cd %S
3-
# RUN: %lldb %T/uuid-matching-mac.out -s %s -o exit | FileCheck %s
4+
# RUN: %lldb %t.dir/uuid-matching-mac.out -s %s -o exit | FileCheck %s
45

56
target symbols add Inputs/uuid-matching-mac.syms
67
# CHECK-LABEL: target symbols add

lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# We want to keep the symbol "multiplyByThree" in the .dynamic section and not
44
# have it put the default .symtab section.
5-
# RUN: echo "{multiplyByThree;};" > %T/dynmic-symbols.txt
6-
# RUN: %clang_host -Wl,--dynamic-list=%T/dynmic-symbols.txt -g -o %t.binary %p/Inputs/minidebuginfo-main.c
5+
# RUN: echo "{multiplyByThree;};" > %t.dynmic-symbols.txt
6+
# RUN: %clang_host -Wl,--dynamic-list=%t.dynmic-symbols.txt -g -o %t.binary %p/Inputs/minidebuginfo-main.c
77

88
# The following section is adapted from GDB's official documentation:
99
# http://sourceware.org/gdb/current/onlinedocs/gdb/MiniDebugInfo.html#MiniDebugInfo

lldb/test/Shell/SymbolFile/Breakpad/inline-record.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %T/inline-record.out
2-
# RUN: %lldb %T/inline-record.out -o "target symbols add -s inline-record.out %S/Inputs/inline-record.syms" \
1+
# RUN: mkdir -p %t.dir
2+
# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %t.dir/inline-record.out
3+
# RUN: %lldb %t.dir/inline-record.out -o "target symbols add -s inline-record.out %S/Inputs/inline-record.syms" \
34
# RUN: -s %s | FileCheck --match-full-lines %s
45

56
# CHECK-LABEL: (lldb) image lookup -a 0x400010 -v

lldb/test/Shell/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Test that we handle files which has gaps in the FILE record IDs.
22

3-
# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %T/line-table-discontinuous-file-ids.out
4-
# RUN: %lldb %T/line-table-discontinuous-file-ids.out \
3+
# RUN: mkdir -p %t.dir
4+
# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %t.dir/line-table-discontinuous-file-ids.out
5+
# RUN: %lldb %t.dir/line-table-discontinuous-file-ids.out \
56
# RUN: -o "target symbols add -s line-table-discontinuous-file-ids.out %S/Inputs/line-table-discontinuous-file-ids.syms" \
67
# RUN: -s %s -o exit | FileCheck %s
78

0 commit comments

Comments
 (0)