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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 11:23:34 PDT 2020


MaskRay accepted this revision.
MaskRay 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
----------------
Optional: `yaml2obj --docnum=2 %s -D ADDEND=-1 | obj2yaml | FileCheck ...` can omit intermediate object files.


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:51
+      - Type:   R_X86_64_PC32
+        Offset: 0x0
+        Symbol: foo
----------------
(You can omit `Offset:`)


================
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.
+
----------------
Decimal commas are unneeded because 2147483647 below do not have them.


================
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
+
----------------
`cmp %t4 %t5`

cmp makes it clear that the object files are identical.


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:85
+# RUN: yaml2obj --docnum=2 %s -o %t8 -D ADDEND=0x80000000
+# RUN: llvm-readobj -r %t8 | FileCheck %s --check-prefix=MIN32
+
----------------
`cmp %t7 %t8`


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

https://reviews.llvm.org/D75528





More information about the llvm-commits mailing list