Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions llvm/test/tools/yaml2obj/ELF/section-headers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -454,19 +454,3 @@ Sections:
# LINK-NEXT: [ 2] .ref.first PROGBITS [[#%x,]] [[#%x,]] [[#%x,]] [[#%x,]] 1
# LINK-NEXT: [ 3] .ref.last PROGBITS [[#%x,]] [[#%x,]] [[#%x,]] [[#%x,]] 4
# LINK-NEXT: [ 4] .shstrtab

# Must not crash under Msan.
# RUN: not yaml2obj %s --docnum=15 -o %t15 2>&1 | FileCheck %s --check-prefix=FOO_SECTION

--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Sections:
- Name: .foo
Type: FOO_SECTION
Size: 0x10
Content: [[<none>]]

# FOO_SECTION: invalid hex32 number
32 changes: 30 additions & 2 deletions llvm/test/tools/yaml2obj/ELF/section-type.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RUN: yaml2obj %s -o %t
# RUN: llvm-readobj --sections %t | FileCheck %s
# RUN: yaml2obj %s --docnum=1 -o %t1
# RUN: llvm-readobj --sections %t1 | FileCheck %s

# CHECK: Name: enum
# CHECK: Type: SHT_PROGBITS
Expand All @@ -25,3 +25,31 @@ Sections:
Type: 0xabcd
- Name: decimal
Type: 1234


# RUN: not yaml2obj %s --docnum=2 -o %t2 2>&1 | FileCheck %s --check-prefix=UNKNOWN-TYPE

--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Sections:
- Name: .foo
Type: FOO_SECTION

# UNKNOWN-TYPE: error: invalid hex32 number


# RUN: not yaml2obj %s --docnum=3 -o %t3 -DMACHINE=EM_NONE 2>&1 | FileCheck %s --check-prefix=UNKNOWN-SHT-TYPE

--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Sections:
- Name: .foo
Type: SHT_MIPS_ABIFLAGS

# UNKNOWN-SHT-TYPE: error: invalid hex32 number
Loading