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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 02:14:08 PST 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/obj2yaml/relocation-addend.yaml:1
+## Test how obj2yaml emits relocation addend descriptions.
+## We document that relocation addends are dumped as signed int64 decimal values.
----------------
Should we check 0 too? Not sure really, but I suppose it shows that the value 0 is printed, despite being entirely leading zeroes.


================
Comment at: llvm/test/tools/obj2yaml/relocation-addend.yaml:7
+## Check how obj2yaml dumps an addend with an arbitrary positive value.
+## We use -1 as it is the first possible positive value.
+# RUN: yaml2obj --docnum=1 %s -o %t1 -D ADDEND=1
----------------
-1 -> 1


================
Comment at: llvm/test/tools/obj2yaml/relocation-addend.yaml:22
+
+## Check how obj2yaml dumps an addend with the value = MAX_INT64.
+# RUN: yaml2obj --docnum=1 %s -o %t3 -D ADDEND=9223372036854775807
----------------
grimar wrote:
> MaskRay wrote:
> > The stdint.h constant is named `INT64_MIN`
> > 
> > Testing the hexadecimal literal will be useful, too.
> It is a test for `obj2yaml`, it only can print decimals.
> 
> Hexadecimal values as inputs are tested in yaml2obj test suite.
> 
> > The stdint.h constant is named INT64_MIN
> 
> I'll rename, thanks.
You don't need the '=' sign here. Just "with the value INT64_MIN" works.


================
Comment at: llvm/test/tools/obj2yaml/relocation-addend.yaml:54
+## Check how obj2yaml dumps an addend with an arbitrary positive value.
+## We use -1 as it is the first possible positive value.
+# RUN: yaml2obj --docnum=2 %s -o %t5 -D ADDEND=1
----------------
-1 -> 1


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:1
+## Here we document how yaml2obj handles a relocation addend description.
+
----------------
handles relocation addend descriptions


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:13
+
+## MAX64: 0x0 R_X86_64_PC32 foo 0x7FFFFFFFFFFFFFFF
+
----------------
Single '#'.


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:16
+## Case 1.2: Check we report an error when an addend is greater than INT64_MAX and
+## it is in a decimal form. We use (INT64_MAX + 1).
+# RUN: not yaml2obj %s -o %t3 -D ADDEND=9223372036854775808 2>&1 | FileCheck %s --check-prefix=OVERFLOW64
----------------
in decimal form

Same elsewhere


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:27
+
+## MIN64: 0x0 R_X86_64_PC32 foo 0x8000000000000000
+
----------------
'#'


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

https://reviews.llvm.org/D75528





More information about the llvm-commits mailing list