This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][test] Add dedicated llvm-readobj test.
ClosedPublic

Authored by rampitec on Aug 10 2020, 12:59 PM.

Diff Detail

Event Timeline

rampitec created this revision.Aug 10 2020, 12:59 PM
Herald added a project: Restricted Project. · View Herald Transcript
rampitec requested review of this revision.Aug 10 2020, 12:59 PM

I seem to recall that for test only change, the tag can be [test] or test instead of NFC

llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test
1

You can use yaml2obj -D FLAGS= to avoid replicate so many YAML inputs.

See file-header-machine-types.test for an example.

Thanks for the test!

llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test
5

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.

rampitec updated this revision to Diff 284854.Aug 11 2020, 12:34 PM
rampitec marked 2 inline comments as done.

Reduced test size and used defines in run lines.

jhenderson accepted this revision.Aug 12 2020, 1:42 AM

LGTM, with a couple of suggested simplifications.

llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test
2

There's only one file now, so you can get rid of --docnum from every yaml2obj invocation.

3

Since there's now only one check prefix, let's simplify to the default CHECK

This revision is now accepted and ready to land.Aug 12 2020, 1:42 AM
rampitec updated this revision to Diff 285095.Aug 12 2020, 8:58 AM
rampitec marked 2 inline comments as done.
rampitec retitled this revision from [AMDGPU] Add dedicated llvm-readobj test. NFC. to [AMDGPU][test] Add dedicated llvm-readobj test..
This revision was automatically updated to reflect the committed changes.