[PATCH] D78110: [LLVM/tools][test] - Remove/fix dead check prefixes.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 14 08:33:15 PDT 2020
grimar created this revision.
grimar added reviewers: jhenderson, MaskRay, mstorsjo.
Herald added subscribers: steven.zhang, rupprecht, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a reviewer: rupprecht.
mstorsjo added inline comments.
================
Comment at: llvm/test/tools/llvm-objcopy/COFF/patch-debug-dir.test:21
+# SECTIONS-PRE-NEXT: PointerToRawData: 0x600
+# SECTIONS-POST-NEXT: PointerToRawData: 0x400
----------------
This bit LGTM - oops and thanks.
I've experimented with the code for FileCheck that would
enable reporting a error when there are unknown check-prefixes.
E.g. when we have `--check-prefixes=KNOWN,UNKNOWN`, there is no error
reported about `UNKNOWN`.
The behavior looks wierd to me, but multiple-missing-prefixes.txt
and others FileCheck tests seems explicitly check this behavior.
Also there are about 1000 tests in LLVM
that have unused prefixes. Most of them lives in:
CodeGen/*
DebugInfo/X86/*
Instrumentation/*
Linker/*
MC/*
Other/*
Transforms/*
(A random example:
https://github.com/llvm/llvm-project/blob/master/llvm/test/CodeGen/PowerPC/srem-vector-lkk.ll has an excessive `CHECK`)
At the same time it is obvious that we do not want to have
dead prefixes in `llvm/test/tools` tests. I've fixed all what was able to find.
Note: this fixes patch-debug-dir.test.
https://reviews.llvm.org/D78110
Files:
llvm/test/tools/llvm-dwp/X86/merge.test
llvm/test/tools/llvm-objcopy/COFF/patch-debug-dir.test
llvm/test/tools/llvm-objcopy/ELF/set-section-flags-multiple.test
llvm/test/tools/llvm-objcopy/MachO/strip-all.test
llvm/test/tools/llvm-readobj/archive.test
llvm/test/tools/llvm-symbolizer/split-dwarf.test
Index: llvm/test/tools/llvm-symbolizer/split-dwarf.test
===================================================================
--- llvm/test/tools/llvm-symbolizer/split-dwarf.test
+++ llvm/test/tools/llvm-symbolizer/split-dwarf.test
@@ -5,7 +5,7 @@
RUN: cd %t
RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
-RUN: --obj=%p/Inputs/split-dwarf-test 0x400504 0x4004f4 | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s
+RUN: --obj=%p/Inputs/split-dwarf-test 0x400504 0x4004f4 | FileCheck --check-prefix=SPLIT --check-prefix=DWO %s
Ensure we get the same results in the absence of gmlt-like data in the executable but the presence of a .dwo file
Index: llvm/test/tools/llvm-readobj/archive.test
===================================================================
--- llvm/test/tools/llvm-readobj/archive.test
+++ llvm/test/tools/llvm-readobj/archive.test
@@ -8,8 +8,8 @@
# RUN: yaml2obj --docnum=3 %s -o %t.dir/trivial.obj.coff-arm
# RUN: llvm-ar rc %t.a %t.dir/trivial.obj.elf-x86-64 %t.dir/trivial.obj.elf-i386 %t.dir/trivial.obj.coff-arm
-# RUN: llvm-readobj --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=HEADER,LLVM,COFF
-# RUN: llvm-readelf --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=HEADER,GNU,COFF
+# RUN: llvm-readobj --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=LLVM,COFF
+# RUN: llvm-readelf --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=GNU,COFF
# LLVM: {{^$}}
# LLVM-NEXT: File: [[ARFILE]](trivial.obj.elf-x86-64)
Index: llvm/test/tools/llvm-objcopy/MachO/strip-all.test
===================================================================
--- llvm/test/tools/llvm-objcopy/MachO/strip-all.test
+++ llvm/test/tools/llvm-objcopy/MachO/strip-all.test
@@ -9,7 +9,7 @@
# RUN: llvm-objcopy --strip-all %t.exec %t.exec.stripped
# RUN: llvm-readobj --sections --relocations --symbols %t.exec.stripped \
-# RUN: | FileCheck --check-prefixes=COMMON,EXEC %s
+# RUN: | FileCheck --check-prefix=COMMON %s
# RUN: llvm-objcopy --strip-all %t.dwarf %t.dwarf.stripped
# RUN: llvm-readobj --sections --relocations --symbols %t.dwarf.stripped \
Index: llvm/test/tools/llvm-objcopy/ELF/set-section-flags-multiple.test
===================================================================
--- llvm/test/tools/llvm-objcopy/ELF/set-section-flags-multiple.test
+++ llvm/test/tools/llvm-objcopy/ELF/set-section-flags-multiple.test
@@ -1,7 +1,7 @@
# RUN: yaml2obj %s -o %t
# RUN: llvm-objcopy --set-section-flags=.foo=alloc --set-section-flags=.bar=code %t %t.2
-# RUN: llvm-readobj --sections %t.2 | FileCheck %s --check-prefixes=CHECK,ALLOC,WRITE
+# RUN: llvm-readobj --sections %t.2 | FileCheck %s
!ELF
FileHeader:
Index: llvm/test/tools/llvm-objcopy/COFF/patch-debug-dir.test
===================================================================
--- llvm/test/tools/llvm-objcopy/COFF/patch-debug-dir.test
+++ llvm/test/tools/llvm-objcopy/COFF/patch-debug-dir.test
@@ -17,8 +17,8 @@
# SECTIONS-NEXT: VirtualSize:
# SECTIONS-NEXT: VirtualAddress:
# SECTIONS-NEXT: RawDataSize:
-# SECTIONS-NEXT-PRE: PointerToRawData: 0x800
-# SECTIONS-NEXT-POST: PointerToRawData: 0x400
+# SECTIONS-PRE-NEXT: PointerToRawData: 0x600
+# SECTIONS-POST-NEXT: PointerToRawData: 0x400
--- !COFF
OptionalHeader:
Index: llvm/test/tools/llvm-dwp/X86/merge.test
===================================================================
--- llvm/test/tools/llvm-dwp/X86/merge.test
+++ llvm/test/tools/llvm-dwp/X86/merge.test
@@ -1,5 +1,5 @@
RUN: llvm-dwp %p/../Inputs/merge/notypes/c.dwo %p/../Inputs/merge/notypes/ab.dwp -o - | \
-RUN: llvm-dwarfdump -v - | FileCheck --check-prefix=CHECK --check-prefix=NOTYP %s
+RUN: llvm-dwarfdump -v - | FileCheck --check-prefix=CHECK %s
DWP from a DWO (c.dwo) and a DWP (ab.dwp, created from a.dwo and b.dwo)
Make sure the entries for A and B are updated correctly when read/processed from ab.dwp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78110.257342.patch
Type: text/x-patch
Size: 3961 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200414/7dbe0cd7/attachment.bin>
More information about the llvm-commits
mailing list