Skip to content

Commit dd405f1

Browse files
committed
Revert D83834 "Add test utility 'extract'"
This reverts commit d054c7e. There are discussions about the utility name, its functionality and user interface. Revert before we reach consensus.
1 parent 740a164 commit dd405f1

File tree

17 files changed

+36
-276
lines changed

17 files changed

+36
-276
lines changed

lld/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ configure_lit_site_cfg(
2525
set(LLD_TEST_DEPS lld)
2626
if (NOT LLD_BUILT_STANDALONE)
2727
list(APPEND LLD_TEST_DEPS
28-
FileCheck count extract llc llvm-ar llvm-as llvm-bcanalyzer llvm-config llvm-cvtres
28+
FileCheck count llc llvm-ar llvm-as llvm-bcanalyzer llvm-config llvm-cvtres
2929
llvm-dis llvm-dwarfdump llvm-lib llvm-lipo llvm-mc llvm-nm llvm-objcopy
3030
llvm-objdump llvm-pdbutil llvm-readelf llvm-readobj llvm-strip not obj2yaml
3131
opt yaml2obj

lld/test/ELF/linkerscript/noload.s

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# REQUIRES: x86
2-
# RUN: extract asm %s -o %t.s && extract lds %s -o %t.lds
3-
# RUN: llvm-mc -filetype=obj -triple=x86_64 %t.s -o %t.o
4-
# RUN: ld.lld -o %t --script %t.lds %t.o
2+
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3+
# RUN: echo "SECTIONS { \
4+
# RUN: .data_noload_a (NOLOAD) : { *(.data_noload_a) } \
5+
# RUN: .data_noload_b (0x10000) (NOLOAD) : { *(.data_noload_b) } \
6+
# RUN: .no_input_sec_noload (NOLOAD) : { . += 1; } \
7+
# RUN: .text (0x20000) : { *(.text) } };" > %t.script
8+
# RUN: ld.lld -o %t --script %t.script %t.o
59
# RUN: llvm-readelf -S -l %t | FileCheck %s
610

711
# CHECK: Name Type Address Off Size
@@ -12,7 +16,6 @@
1216
# CHECK: Type Offset VirtAddr PhysAddr
1317
# CHECK-NEXT: LOAD 0x001000 0x0000000000020000 0x0000000000020000
1418

15-
#--- asm
1619
.section .text,"ax",@progbits
1720
nop
1821

@@ -21,11 +24,3 @@
2124

2225
.section .data_noload_b,"aw",@progbits
2326
.zero 4096
24-
25-
#--- lds
26-
SECTIONS {
27-
.data_noload_a (NOLOAD) : { *(.data_noload_a) }
28-
.data_noload_b (0x10000) (NOLOAD) : { *(.data_noload_b) }
29-
.no_input_sec_noload (NOLOAD) : { . += 1; }
30-
.text (0x20000) : { *(.text) }
31-
}

lld/test/lit.cfg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
llvm_config.use_lld()
4040

4141
tool_patterns = [
42-
'extract', 'llc', 'llvm-as', 'llvm-mc', 'llvm-nm', 'llvm-objdump',
43-
'llvm-pdbutil', 'llvm-dwarfdump', 'llvm-readelf', 'llvm-readobj',
44-
'obj2yaml', 'yaml2obj', 'opt', 'llvm-dis']
42+
'llc', 'llvm-as', 'llvm-mc', 'llvm-nm', 'llvm-objdump', 'llvm-pdbutil',
43+
'llvm-dwarfdump', 'llvm-readelf', 'llvm-readobj', 'obj2yaml', 'yaml2obj',
44+
'opt', 'llvm-dis']
4545

4646
llvm_config.add_tool_substitutions(tool_patterns)
4747

@@ -87,7 +87,7 @@
8787
# Indirectly check if the mt.exe Microsoft utility exists by searching for
8888
# cvtres, which always accompanies it. Alternatively, check if we can use
8989
# libxml2 to merge manifests.
90-
if (lit.util.which('cvtres', config.environment['PATH']) or
90+
if (lit.util.which('cvtres', config.environment['PATH']) or
9191
config.llvm_libxml2_enabled):
9292
config.available_features.add('manifest_tool')
9393

llvm/docs/TestingGuide.rst

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -271,27 +271,8 @@ adding your code there instead of creating a new file.
271271
Extra files
272272
-----------
273273

274-
If your test requires extra files besides the file containing the ``RUN:`` lines
275-
and the extra files are small, consider specifying them in the same file and
276-
using ``extract`` to extract them. For example,
277-
278-
.. code-block:: llvm
279-
280-
; RUN: extract b %s -o %tb.ll
281-
; RUN: extract a %s | llvm-link - %tb.ll -S | FileCheck %s
282-
283-
; CHECK: ...
284-
285-
;--- a
286-
...
287-
;--- b
288-
...
289-
290-
The parts are separated by the regex ``^(.|//)--- <part>``. By default the
291-
extracted content has leading empty lines to preserve line numbers. Specify
292-
``--no-leading-lines`` to drop leading lines.
293-
294-
If the extra files are large, the idiomatic place to put them is in a subdirectory ``Inputs``.
274+
If your test requires extra files besides the file containing the ``RUN:``
275+
lines, the idiomatic place to put them is in a subdirectory ``Inputs``.
295276
You can then refer to the extra files as ``%S/Inputs/foo.bar``.
296277

297278
For example, consider ``test/Linker/ident.ll``. The directory structure is

llvm/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ set(LLVM_TEST_DEPENDS
5252
UnitTests
5353
bugpoint
5454
count
55-
extract
5655
llc
5756
lli
5857
lli-child-target

llvm/test/lit.cfg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def get_asan_rtlib():
130130
config.llvm_locstats_used = os.path.exists(llvm_locstats_tool)
131131

132132
tools = [
133-
ToolSubst('%extract', FindTool('extract')),
134133
ToolSubst('%lli', FindTool('lli'), post='.', extra_args=lli_args),
135134
ToolSubst('%llc_dwarf', FindTool('llc'), extra_args=llc_args),
136135
ToolSubst('%go', config.go_executable, unresolved='ignore'),

llvm/test/tools/extract/Inputs/basic-aa.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

llvm/test/tools/extract/Inputs/basic-bb.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

llvm/test/tools/extract/basic.test

Lines changed: 0 additions & 32 deletions
This file was deleted.

llvm/test/tools/extract/help.test

Lines changed: 0 additions & 5 deletions
This file was deleted.

llvm/test/tools/extract/no-leading-lines.test

Lines changed: 0 additions & 10 deletions
This file was deleted.

llvm/test/tools/gold/X86/multiple-sections.ll

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
; RUN: extract order %s -o %t.order
2-
; RUN: extract ir %s | llvm-as -o %t.o
1+
; RUN: echo ".text.tin" > %t_order_lto.txt
2+
; RUN: echo ".text._start" >> %t_order_lto.txt
3+
; RUN: echo ".text.pat" >> %t_order_lto.txt
4+
; RUN: llvm-as %s -o %t.o
35
; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
46
; RUN: -m elf_x86_64 -o %t.exe %t.o \
5-
; RUN: --section-ordering-file=%t.order
7+
; RUN: --section-ordering-file=%t_order_lto.txt
68
; RUN: llvm-readelf -s %t.exe | FileCheck %s
79

810
; Check that the order of the sections is tin -> _start -> pat.
@@ -11,12 +13,6 @@
1113
; CHECK: 00000000004000b0 1 FUNC LOCAL DEFAULT 1 tin
1214
; CHECK: 00000000004000c0 15 FUNC GLOBAL DEFAULT 1 _start
1315

14-
;--- order
15-
.text.tin
16-
.text._start
17-
.text.pat
18-
19-
;--- ir
2016
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
2117
target triple = "x86_64-unknown-linux-gnu"
2218

llvm/test/tools/llvm-objcopy/ELF/strip-symbol.test

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
# RUN: extract yaml %s | yaml2obj - -o %t
1+
# RUN: yaml2obj %s -o %t
22
# RUN: llvm-objcopy --strip-symbol baz -N bar %t %t2
33
# RUN: llvm-readobj --symbols --sections %t2 | FileCheck %s
44
# RUN: llvm-strip --strip-symbol baz -N bar %t -o %t3
55
# RUN: cmp %t2 %t3
66
# RUN: llvm-strip --regex --strip-symbol '^b.*' -N bar %t -o %t4
77
# RUN: cmp %t3 %t4
8-
# RUN: extract list1 %s -o %t-list.txt && llvm-objcopy --strip-symbols %t-list.txt %t %t5
8+
# RUN: echo " bar # bar" > %t-list.txt
9+
# RUN: echo " baz # baz" >> %t-list.txt
10+
# RUN: echo " # no symbol" >> %t-list.txt
11+
# RUN: llvm-objcopy --strip-symbols %t-list.txt %t %t5
912
# RUN: cmp %t3 %t5
10-
# RUN: extract list2 %s -o %t-list2.txt && llvm-objcopy --regex --strip-symbols %t-list2.txt %t %t6
13+
# RUN: echo "b.* # bar & baz" > %t-list2.txt
14+
# RUN: llvm-objcopy --regex --strip-symbols %t-list2.txt %t %t6
1115
# RUN: cmp %t3 %t6
1216

13-
#--- list1
14-
bar # bar
15-
baz # baz
16-
# no symbol
17-
18-
#--- list2
19-
b.* # bar & baz
20-
21-
#--- yaml
2217
!ELF
2318
FileHeader:
2419
Class: ELFCLASS64

llvm/test/tools/llvm-strings/radix.test

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
## Show that llvm-strings can handle the -t/--radix switch properly.
22

3-
RUN: extract --no-leading-lines input %s -o %t
4-
#--- input
5-
one
6-
two
7-
three
8-
four
9-
five
10-
six
11-
seven
12-
eight
13-
nine
14-
ten
15-
#--- end
3+
RUN: echo one > %t
4+
RUN: echo two >> %t
5+
RUN: echo three >> %t
6+
RUN: echo four >> %t
7+
RUN: echo five >> %t
8+
RUN: echo six >> %t
9+
RUN: echo seven >> %t
10+
RUN: echo eight >> %t
11+
RUN: echo nine >> %t
12+
RUN: echo ten >> %t
1613

1714
RUN: llvm-strings %t | FileCheck %s -check-prefix CHECK-NONE --implicit-check-not={{.}}
1815
RUN: llvm-strings -t d %t | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace --implicit-check-not={{.}}

llvm/tools/extract/.clang-tidy

Lines changed: 0 additions & 19 deletions
This file was deleted.

llvm/tools/extract/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)