1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[Object][ELF] Test unknown type.

llvm-svn: 226943
This commit is contained in:
Michael J. Spencer 2015-01-23 21:58:09 +00:00
parent 72bb9f2990
commit e8e8139d22
3 changed files with 12 additions and 1 deletions

View File

@ -30,6 +30,7 @@ ScalarEnumerationTraits<ELFYAML::ELF_ET>::enumeration(IO &IO,
ECase(ET_DYN)
ECase(ET_CORE)
#undef ECase
IO.enumFallback<Hex16>(Value);
}
void

View File

@ -960,7 +960,7 @@ file_magic identify_magic(StringRef Magic) {
unsigned low = Data2MSB ? 17 : 16;
if (Magic[high] == 0)
switch (Magic[low]) {
default: break;
default: return file_magic::elf;
case 1: return file_magic::elf_relocatable;
case 2: return file_magic::elf_executable;
case 3: return file_magic::elf_shared_object;

View File

@ -0,0 +1,10 @@
# RUN: yaml2obj -format=elf %s | llvm-readobj -file-headers - | FileCheck %s
!ELF
FileHeader: !FileHeader
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: 42
Machine: EM_X86_64
# CHECK: Type: 0x2A