[PATCH] D75527: [yaml2obj] - Add `ELFYAML::YAMLInt` to fix how we parse a relocation `Addend` key.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 02:58:43 PDT 2020


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM, with a couple of suggestions.



================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:136
+## Case 4: Check we do not allow invalid values.
+# RUN: not yaml2obj %s -D ADDEND=0x1122QQEE 2>&1 | FileCheck %s --check-prefix=ERR
+# RUN: not yaml2obj %s -D ADDEND=-0x1122QQEE 2>&1 | FileCheck %s --check-prefix=ERR
----------------
Maybe these should use 'G' instead of 'Q', since that's the first invalid value?


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:139
+# RUN: not yaml2obj %s -D ADDEND=1234Q5 2>&1 | FileCheck %s --check-prefix=ERR
+# RUN: not yaml2obj %s -D ADDEND=-1234Q5 2>&1 | FileCheck %s --check-prefix=ERR
+# RUN: not yaml2obj %s -D ADDEND=foo 2>&1 | FileCheck %s --check-prefix=ERR
----------------
Maybe also worth testing '-' on its own, and '--1234'.


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

https://reviews.llvm.org/D75527





More information about the llvm-commits mailing list