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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 06:03:29 PDT 2020


grimar added inline comments.


================
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
----------------
jhenderson wrote:
> 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.
Done.


================
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
----------------
jhenderson wrote:
> (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)
Probably we should print "Unknown". This is what we do for `--sections`. E.g:

```
Type: Unknown (0x1C7)
```


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

https://reviews.llvm.org/D85526



More information about the llvm-commits mailing list