[PATCH] D86350: [llvm-readobj][test] - Test "Format" values.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 28 01:33:12 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4cd14256b23a: [llvm-readobj][test] - Test "Format" values. (authored by grimar).
Changed prior to commit:
https://reviews.llvm.org/D86350?vs=287978&id=288550#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86350/new/
https://reviews.llvm.org/D86350
Files:
llvm/test/tools/llvm-readobj/ELF/file-header-format.test
Index: llvm/test/tools/llvm-readobj/ELF/file-header-format.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-readobj/ELF/file-header-format.test
@@ -0,0 +1,27 @@
+## This tests "Format" values printed by llvm-readobj.
+
+## The "Format" value printed depends on values stored in e_ident[EI_CLASS],
+## e_ident[EI_DATA] and e_machine fields of an ELF file header.
+## We test all possible values in unittests\Object\ELFObjectFileTest.cpp,
+## here we test just a few of them to demonstrate that llvm-readobj prints the same.
+
+# RUN: yaml2obj %s -o %t.none64.o
+# RUN: llvm-readobj --file-headers %t.none64.o | FileCheck %s -DFMT="elf64-unknown"
+
+# RUN: yaml2obj %s -o %t.none32.o -DCLASS=32
+# RUN: llvm-readobj --file-headers %t.none32.o | FileCheck %s -DFMT="elf32-unknown"
+
+# RUN: yaml2obj %s -o %t.i386-32.o -DMACHINE=EM_386 -DCLASS=32
+# RUN: llvm-readobj --file-headers %t.i386-32.o | FileCheck %s -DFMT="elf32-i386"
+
+# RUN: yaml2obj %s -o %t.x86_64.o -DMACHINE=EM_X86_64
+# RUN: llvm-readobj --file-headers %t.x86_64.o | FileCheck %s -DFMT="elf64-x86-64"
+
+# CHECK: Format: [[FMT]]
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS[[CLASS=64]]
+ Data: ELFDATA2[[DATA=LSB]]
+ Type: ET_REL
+ Machine: [[MACHINE=EM_NONE]]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86350.288550.patch
Type: text/x-patch
Size: 1301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200828/9ac132ea/attachment.bin>
More information about the llvm-commits
mailing list