[PATCH] D85526: [llvm-readobj] - Refine program headers testing (`-l`, `--program-headers` and `--segments`).

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 02:19:31 PDT 2020


jhenderson added a comment.

I think for diffing purposes, it would probably be best to rename in a separate commit.



================
Comment at: llvm/test/tools/llvm-readobj/ELF/gnu-phdrs.test:22-24
 # RUN: llvm-readelf -l %t32.elf | \
 # RUN:   FileCheck %s --check-prefixes=ELF32,MAPPING --strict-whitespace --match-full-lines
+# RUN: llvm-readobj -l %t32.elf | FileCheck %s --check-prefixes=ELF-LLVM,ELF32-LLVM
----------------
Could these just change to calling FileCheck with the text file as an input file:

```
# RUN: FileCheck %s --check-prefixes=ELF32,MAPPING --strict-whitespace --match-full-lines --input-file=$t.readelf-l.txt
# RUN: FileCheck %s --check-prefixes=ELF-LLVM,ELF32-LLVM --input-file=%t.readobj-l.txt
```

Also, it might be wise to add at least `--match-full-lines` to all llvm-readobj checks, because it will prevent numeric values spuriously matching when there are more digits. For example, without it `CHECK: Value: 0x1234` would also match `Value: 0x12345678`, I believe.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/gnu-phdrs.test:224
+# ELF-LLVM-NEXT:   ProgramHeader {
+# ELF-LLVM-NEXT:     Type:  (0x60000000)
+# ELF32-LLVM-NEXT:   Offset: 0x314
----------------
(Aside: I'm sure you've noticed there's a bug here and in similar cases below - we probably should be printing "<unknown>" or similar)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85526/new/

https://reviews.llvm.org/D85526



More information about the llvm-commits mailing list