[PATCH] D130238: [LoongArch] Parse LoongArch base ABI in ObjectYAML and llvm-readobj
Lu Weining via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 22 00:46:27 PDT 2022
SixWeining added inline comments.
================
Comment at: llvm/test/tools/llvm-readobj/ELF/loongarch-eflags.test:3
+
+# RUN: yaml2obj --docnum=1 %s > %t-lp64s
+# RUN: llvm-readobj -h %t-lp64s | FileCheck --check-prefix=READOBJ-LP64S %s
----------------
jhenderson wrote:
> Minor nit: we're tending to move away from piping to a file in favour of using `-o` to write the output to that file. The logic is that it's easier to copy and paste the command from the test output to reproduce the test run.
OK. Thanks.
================
Comment at: llvm/test/tools/llvm-readobj/ELF/loongarch-eflags.test:64
+ Machine: EM_LOONGARCH
+ Flags: [ EF_LOONGARCH_BASE_ABI_LP64S ]
+...
----------------
jhenderson wrote:
> jhenderson wrote:
> > Didn't see this earlier, sorry, but yaml2obj has an option (which might not have been available when existing tests were written) to allow text substitution within the YAML, a bit like FileCheck's -D option. Approximate example (not tested, but should be enough of an idea to get it to work):
> >
> > ```
> > # RUN: yaml2obj %s -o %t-lp64s -DFLAG=LP64S
> >
> > ...
> >
> > --- !ELF
> > FileHeader:
> > Class: ELFCLASS64
> > Data: ELFDATA2LSB
> > Type: ET_EXEC
> > Machine: EM_LOONGARCH
> > Flags: [ EF_LOONGARCH_BASE_ABI_[[FLAG]] ]
> > ```
> > This will allow you to only have one YAML block.
> Missed that there was different Class values in some of the YAML blocks, but that can be solved in the same manner with a different variable.
Thanks. Yes, this can reduce many lines.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130238/new/
https://reviews.llvm.org/D130238
More information about the llvm-commits
mailing list