[PATCH] D85683: [AMDGPU] Add dedicated llvm-readobj test. NFC.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 01:51:30 PDT 2020


jhenderson added a comment.

Thanks for the test!



================
Comment at: llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test:5
+# RUN: yaml2obj %s --docnum=2 -o %t
+# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX601
+
----------------
It might be clearer to use FileCheck's `-D` option to sepcify the expected flag output, to avoid needing lots of different check lines:

```
# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t -DFLAG='EF_AMDGPU_MACH_AMDGCN_GFX600 (0x20)'
...
# CHECK-NEXT: Flags: [ {{.*}}
# CHECK-NEXT: [[FLAG]]
...
```
You can then change the value in each command, but share the same check everywhere. Note that I've also put the `{{.*}}` bit instead of the (0x...) bit for the total flags value, since that's not really important (the value is included on the next line anyway).

Up to you though.


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

https://reviews.llvm.org/D85683



More information about the llvm-commits mailing list