[PATCH] D75528: [yaml2obj][obj2yaml][test] - Add base tests for relocation addends.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 03:41:29 PDT 2020


grimar marked 7 inline comments as done.
grimar added inline comments.


================
Comment at: llvm/test/tools/obj2yaml/relocation-addend.yaml:72
+## We use -1 as it is the first possible negative value.
+# RUN: yaml2obj --docnum=2 %s -o %t8 -D ADDEND=-1
+# RUN: obj2yaml %t8 | FileCheck %s --check-prefix=ELF32 --match-full-lines -DADDEND=-1
----------------
MaskRay wrote:
> Optional: `yaml2obj --docnum=2 %s -D ADDEND=-1 | obj2yaml | FileCheck ...` can omit intermediate object files.
I prefer do not use "|" because I find such tests harder to work with when they fail.


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:60
+## Case 2.1: Document we accept an addend with the
+## value INT32_MAX = 2^31-1 = 0x7FFFFFFF = 2,147,483,647.
+
----------------
MaskRay wrote:
> Decimal commas are unneeded because 2147483647 below do not have them.
Because `2147483647` below are not a part of a comment :)
`2,147,483,647` is easier to read.
(Imagine if I wanted to mention 2^63 in a comment, which is `9223372036854775807`. It
would be better to write it as `9,223,372,036,854,775,807` instead I think).


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:65
+# RUN: yaml2obj --docnum=2 %s -o %t5 -D ADDEND=0x7FFFFFFF
+# RUN: llvm-readobj -r %t5 | FileCheck %s --check-prefix=MAX32
+
----------------
MaskRay wrote:
> `cmp %t4 %t5`
> 
> cmp makes it clear that the object files are identical.
Right. Done.


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

https://reviews.llvm.org/D75528





More information about the llvm-commits mailing list