llvm-project/llvm/test/tools/gold/X86
Fangrui Song bcea3a7a28 Add test utility 'split-file'
See https://lists.llvm.org/pipermail/llvm-dev/2020-July/143373.html
"[llvm-dev] Multiple documents in one test file" for some discussions.

This patch has explored several alternatives. The current semantics are similar to
what @dblaikie proposed.
`split-file filename output` splits the input file into multiple parts separated by
regex `^(.|//)--- filename` and write each part to the file `output/filename`
(`filename` can include path separators).

Use case A (organizing input of different formats (e.g. linker
script+assembly) in one file).

```
# RUN: split-file %s %t
# RUN: llvm-mc %t/asm -o %t.o
# RUN: ld.lld -T %t/lds %t.o -o %t
This is sometimes better than the %S/Inputs/ approach because the user
can see the auxiliary files immediately and don't have to open another file.

# asm
...
# lds
...
```

Use case B (for utilities which don't have built-in input splitting
feature):

```
// RUN: split-file %s %t
// RUN: llc < %t/1.ll | FileCheck %s --check-prefix=CASE1
// RUN: llc < %t/2.ll | FileCheck %s --check-prefix=CASE2
Combing tests prudently can improve readability.
For example, when testing parsing errors if the recovery mechanism isn't possible,
grouping the tests in one file can more readily see test coverage/strategy.

//--- 1.ll
...
//--- 2.ll
...
```

Since this is a new utility, there is no git history concerns for
UpperCase variable names. I use lowerCase variable names like mlir/lld.

Reviewed By: jhenderson, lattner

Differential Revision: https://reviews.llvm.org/D83834
2020-08-03 20:42:09 -07:00
..
Inputs [ThinLTO] Auto-hide prevailing linkonce_odr only when all copies eligible 2019-05-10 20:08:24 +00:00
v1.12 [ThinLTO] Import readonly vars with refs 2019-11-07 15:13:35 +03:00
v1.16 [test] llvm/test/: change llvm-objdump single-dash long options to double-dash options 2020-03-15 17:46:23 -07:00
alias.ll
alias2.ll
asm_undefined.ll
asm_undefined2.ll
available-externally.ll
bad-alias.ll
bcsection.ll [llvm-nm][llvm-readelf] Avoid single-dash -long-option in tests 2019-04-27 16:12:14 +00:00
cache.ll [LLVMgold.so][test] Fix tests after D84132/55fa315b0352 2020-07-21 10:18:32 -07:00
coff.ll
comdat.ll [llvm-readobj] Change -t to --symbols in tests. NFC 2019-05-01 09:28:24 +00:00
comdat2.ll
common.ll
common_thinlto.ll
ctors.ll
ctors2.ll
devirt_vcall_vis_public.ll Restore "[LTO/WPD] Enable aggressive WPD under LTO option" 2020-01-27 07:55:05 -08:00
disable-verify.ll
drop-debug.ll
drop-linkage.ll
emit-asm.ll
emit-llvm.ll [LLVMgold.so][test] Fix tests after D84132/55fa315b0352 2020-07-21 10:18:32 -07:00
error-unopenable.ll
global_with_section.ll
invalid.ll
irmover-error.ll
linker-script.ll
linkonce-weak.ll
linkonce_odr_unnamed_addr.ll [Gold Tests] Add missing target flag to X86 test 2019-12-04 11:50:44 -06:00
lit.local.cfg
mixed_lto.ll
module_asm.ll
multiple-data.s [gold] Fix two readelf tests after rL359649 2019-05-01 09:01:10 +00:00
multiple-sections.ll Add test utility 'split-file' 2020-08-03 20:42:09 -07:00
new-pm.ll
no-map-whole-file.ll
opt-level.ll [ThinLTO] Pass down opt level to LTO backend and handle -O0 LTO in new PM 2019-04-23 18:56:19 +00:00
opt-remarks.ll [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +00:00
parallel.ll [LLVMgold.so] -plugin-opt=save-temps: save combined module to .lto.o instead of .o 2020-07-20 10:02:56 -07:00
pr19901.ll [llvm-readobj] Change -t to --symbols in tests. NFC 2019-05-01 09:28:24 +00:00
pr19901_thinlto.ll [llvm-readobj] Change -t to --symbols in tests. NFC 2019-05-01 09:28:24 +00:00
pr25907.ll
pr25915.ll
relax-relocs.ll [LLVMgold.so][test] Fix tests after D84132/55fa315b0352 2020-07-21 10:18:32 -07:00
relocatable.ll [llvm-readobj] Change -long-option to --long-option in tests. NFC 2019-05-01 05:27:20 +00:00
relocation-model-pic.ll [LLVMgold.so] -plugin-opt=save-temps: save combined module to .lto.o instead of .o 2020-07-20 10:02:56 -07:00
remarks.ll
resolve-to-alias.ll
slp-vectorize-pm.ll [ThinLTO] Pass CodeGenOpts like UnrollLoops/VectorizeLoop/VectorizeSLP 2020-01-09 21:13:11 -08:00
slp-vectorize.ll
split-dwarf.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
start-lib-common.ll
stats-file-option.ll
stats.ll
strip_names.ll Fix check in tools/gold/X86/strip_names.ll regarding unnamed args 2019-08-08 12:11:13 +00:00
thinlto.ll [LLVMgold.so] -plugin-opt=save-temps: save combined module to .lto.o instead of .o 2020-07-20 10:02:56 -07:00
thinlto_afdo.ll
thinlto_alias.ll
thinlto_archive.ll [llvm-ar][llvm-nm][llvm-size] Change -long-option to --long-option in tests. NFC 2019-05-01 15:31:15 +00:00
thinlto_cspgo.ll
thinlto_emit_imports.ll
thinlto_emit_linked_objects.ll
thinlto_funcimport.ll
thinlto_internalize.ll
thinlto_linkonceresolution.ll
thinlto_no_objects.ll
thinlto_object_suffix_replace.ll
thinlto_prefix_replace.ll
thinlto_weak_library.ll [gold][test] Fix tests after D75713 and D74749 2020-03-06 13:38:04 -08:00
thinlto_weak_resolution.ll
type-merge.ll
type-merge2.ll
unnamed-addr.ll
vectorize.ll
visibility.ll [llvm-readobj] Change -t to --symbols in tests. NFC 2019-05-01 09:28:24 +00:00
weak.ll