summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2014-05-23 08:07:09 +0000
committerSimon Atanasyan <simon@atanasyan.com>2014-05-23 08:07:09 +0000
commit84242dc774be3fae8a9a9f2712e6f37b150aeecc (patch)
tree0f3077aeea2ce77a7ad3180fcc3241d047ac59ae /llvm/test/Object
parent57dd5cf441351531d26d7255a778430904c5288d (diff)
downloadbcm5719-llvm-84242dc774be3fae8a9a9f2712e6f37b150aeecc.tar.gz
bcm5719-llvm-84242dc774be3fae8a9a9f2712e6f37b150aeecc.zip
[YAML] Add an optional argument `EnumMask` to the `yaml::IO::bitSetCase()`.
Some bit-set fields used in ELF file headers in fact contain two parts. The first one is a regular bit-field. The second one is an enumeraion. For example ELF header `e_flags` for MIPS target might contain the following values: Bit-set values: EF_MIPS_NOREORDER = 0x00000001 EF_MIPS_PIC = 0x00000002 EF_MIPS_CPIC = 0x00000004 EF_MIPS_ABI2 = 0x00000020 Enumeration: EF_MIPS_ARCH_32 = 0x50000000 EF_MIPS_ARCH_64 = 0x60000000 EF_MIPS_ARCH_32R2 = 0x70000000 EF_MIPS_ARCH_64R2 = 0x80000000 For printing bit-sets we use the `yaml::IO::bitSetCase()`. It does not support bit-set/enumeration combinations and prints too many flags from an enumeration part. This patch fixes this problem. New method `yaml::IO::maskedBitSetCase()` handle "enumeration" part of bitset defined by provided mask. Patch reviewed by Nick Kledzik and Sean Silva. llvm-svn: 209504
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/obj2yaml.test4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Object/obj2yaml.test b/llvm/test/Object/obj2yaml.test
index db03f5afa4d..1c1526349fd 100644
--- a/llvm/test/Object/obj2yaml.test
+++ b/llvm/test/Object/obj2yaml.test
@@ -191,7 +191,7 @@ ELF-MIPSEL-NEXT: Class: ELFCLASS32
ELF-MIPSEL-NEXT: Data: ELFDATA2LSB
ELF-MIPSEL-NEXT: Type: ET_REL
ELF-MIPSEL-NEXT: Machine: EM_MIPS
-ELF-MIPSEL-NEXT: Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_1, EF_MIPS_ARCH_2, EF_MIPS_ARCH_5, EF_MIPS_ARCH_32 ]
+ELF-MIPSEL-NEXT: Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
ELF-MIPSEL-NEXT: Sections:
ELF-MIPSEL-NEXT: - Name: .text
ELF-MIPSEL-NEXT: Type: SHT_PROGBITS
@@ -285,7 +285,7 @@ ELF-MIPS64EL-NEXT: Class: ELFCLASS64
ELF-MIPS64EL-NEXT: Data: ELFDATA2LSB
ELF-MIPS64EL-NEXT: Type: ET_REL
ELF-MIPS64EL-NEXT: Machine: EM_MIPS
-ELF-MIPS64EL-NEXT: Flags: [ EF_MIPS_ARCH_1, EF_MIPS_ARCH_3 ]
+ELF-MIPS64EL-NEXT: Flags: [ EF_MIPS_ARCH_3 ]
ELF-MIPS64EL-NEXT: Sections:
ELF-MIPS64EL-NEXT: - Name: .text
ELF-MIPS64EL-NEXT: Type: SHT_PROGBITS
OpenPOWER on IntegriCloud