[PATCH] D83481: [yaml2obj] - Refactor header-sh-fields.yaml test.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 00:25:08 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/yaml2obj/ELF/header-sh-fields.yaml:6-12
+# RUN: yaml2obj %s -o %t-default
+# RUN: llvm-readelf --file-headers %t-default | FileCheck %s --check-prefix=DEFAULT
 
-# DEFAULT:   Start of section headers:          88 (bytes into file)
-# DEFAULT:   Size of section headers:           64 (bytes)
-# DEFAULT:   Number of section headers:         3
-# DEFAULT:   Section header string table index: 2
-
---- !ELF
-FileHeader:
-  Class:   ELFCLASS64
-  Data:    ELFDATA2LSB
-  Type:    ET_REL
-  Machine: EM_X86_64
-
-## Override 3 fields: e_shoff, e_shnum and e_shstrndx. Check the output.
-
-# RUN: yaml2obj --docnum=2 %s -o %t2
-# RUN: llvm-readelf --file-headers %t2 | FileCheck %s --check-prefix=CUSTOM
-
-# CUSTOM: Start of section headers:          2 (bytes into file)
-# CUSTOM: Size of section headers:           64 (bytes)
-# CUSTOM: Number of section headers:         3
-# CUSTOM: Section header string table index: 4
+# DEFAULT: Start of section headers:          88 (bytes into file)
+# DEFAULT: Size of section headers:           64 (bytes)
+# DEFAULT: Number of section headers:         3
+# DEFAULT: Section header string table index: 2
----------------
> This case isn't really checking the default values any more. It's checking that the default variable values as specified in the YAML are followed, but the purpose of the check seems to me to be to show what happens when the fields aren't specified.


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

https://reviews.llvm.org/D83481





More information about the llvm-commits mailing list