diff --git a/llvm/test/tools/yaml2obj/coff-arm64.yaml b/llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml rename from llvm/test/tools/yaml2obj/coff-arm64.yaml rename to llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml --- a/llvm/test/tools/yaml2obj/coff-arm64.yaml +++ b/llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml @@ -9,7 +9,7 @@ # ROUNDTRIP: VirtualAddress: 12288 --- !COFF -OptionalHeader: +OptionalHeader: AddressOfEntryPoint: 4096 ImageBase: 1073741824 SectionAlignment: 4096 @@ -26,55 +26,55 @@ SizeOfStackCommit: 4096 SizeOfHeapReserve: 1048576 SizeOfHeapCommit: 4096 - ExportTable: + ExportTable: RelativeVirtualAddress: 0 Size: 0 - ImportTable: + ImportTable: RelativeVirtualAddress: 0 Size: 0 - ResourceTable: + ResourceTable: RelativeVirtualAddress: 0 Size: 0 - ExceptionTable: + ExceptionTable: RelativeVirtualAddress: 12288 Size: 8 - CertificateTable: + CertificateTable: RelativeVirtualAddress: 0 Size: 0 - BaseRelocationTable: + BaseRelocationTable: RelativeVirtualAddress: 0 Size: 0 - Debug: + Debug: RelativeVirtualAddress: 0 Size: 0 - Architecture: + Architecture: RelativeVirtualAddress: 0 Size: 0 - GlobalPtr: + GlobalPtr: RelativeVirtualAddress: 0 Size: 0 - TlsTable: + TlsTable: RelativeVirtualAddress: 0 Size: 0 - LoadConfigTable: + LoadConfigTable: RelativeVirtualAddress: 0 Size: 0 - BoundImport: + BoundImport: RelativeVirtualAddress: 0 Size: 0 - IAT: + IAT: RelativeVirtualAddress: 0 Size: 0 - DelayImportDescriptor: + DelayImportDescriptor: RelativeVirtualAddress: 0 Size: 0 - ClrRuntimeHeader: + ClrRuntimeHeader: RelativeVirtualAddress: 0 Size: 0 -header: +header: Machine: IMAGE_FILE_MACHINE_ARM64 Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ] -sections: +sections: - Name: .text Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] VirtualAddress: 4096 diff --git a/llvm/test/tools/yaml2obj/coff-invalid-alignment.test b/llvm/test/tools/yaml2obj/COFF/invalid-alignment.yaml rename from llvm/test/tools/yaml2obj/coff-invalid-alignment.test rename to llvm/test/tools/yaml2obj/COFF/invalid-alignment.yaml --- a/llvm/test/tools/yaml2obj/coff-invalid-alignment.test +++ b/llvm/test/tools/yaml2obj/COFF/invalid-alignment.yaml @@ -11,4 +11,4 @@ Characteristics: [] SectionData: 00 Alignment: 16384 -symbols: +symbols: [] diff --git a/llvm/test/tools/yaml2obj/coff-symbol-index.yaml b/llvm/test/tools/yaml2obj/COFF/symbol-index.yaml rename from llvm/test/tools/yaml2obj/coff-symbol-index.yaml rename to llvm/test/tools/yaml2obj/COFF/symbol-index.yaml --- a/llvm/test/tools/yaml2obj/coff-symbol-index.yaml +++ b/llvm/test/tools/yaml2obj/COFF/symbol-index.yaml @@ -10,11 +10,11 @@ # RELOCS-NEXT: } # RELOCS-NEXT: ] -# Check that we usually output relocations with SymbolName. -# For relocations with a non-unique symbol name, output -# SymbolTableIndex instead. +## Check that we usually output relocations with SymbolName. +## For relocations with a non-unique symbol name, output +## SymbolTableIndex instead. -# YAML: Relocations: +# YAML: Relocations: # YAML-NEXT: - VirtualAddress: 3 # YAML-NEXT: SymbolTableIndex: 0 # YAML-NEXT: Type: IMAGE_REL_AMD64_REL32 @@ -26,15 +26,15 @@ # YAML-NEXT: Type: IMAGE_REL_AMD64_REL32 --- !COFF -header: +header: Machine: IMAGE_FILE_MACHINE_AMD64 Characteristics: [ ] -sections: +sections: - Name: .text Characteristics: [ ] Alignment: 4 SectionData: 488B0500000000488B0500000000488B0500000000 - Relocations: + Relocations: - VirtualAddress: 3 SymbolTableIndex: 0 Type: IMAGE_REL_AMD64_REL32 @@ -52,7 +52,7 @@ Characteristics: [ ] Alignment: 1 SectionData: '01' -symbols: +symbols: - Name: .rdata Value: 0 SectionNumber: 2 diff --git a/llvm/test/tools/yaml2obj/elf-abiversion.yaml b/llvm/test/tools/yaml2obj/ELF/abiversion.yaml rename from llvm/test/tools/yaml2obj/elf-abiversion.yaml rename to llvm/test/tools/yaml2obj/ELF/abiversion.yaml --- a/llvm/test/tools/yaml2obj/elf-abiversion.yaml +++ b/llvm/test/tools/yaml2obj/ELF/abiversion.yaml @@ -1,9 +1,9 @@ +## Check we are able to parse/emit the ABI version with yaml2obj/obj2yaml. + # RUN: yaml2obj %s -o %t # RUN: llvm-readobj --file-headers %t | FileCheck %s --check-prefix=FROMYAML # RUN: obj2yaml %t | FileCheck %s --check-prefix=TOYAML -## Check we are able to parse/emit the ABI version with yaml2obj/obj2yaml. - # FROMYAML: ABIVersion: 5 # TOYAML: ABIVersion: 0x05 diff --git a/llvm/test/tools/yaml2obj/elf-class-endianness.test b/llvm/test/tools/yaml2obj/ELF/class-endianness.yaml rename from llvm/test/tools/yaml2obj/elf-class-endianness.test rename to llvm/test/tools/yaml2obj/ELF/class-endianness.yaml diff --git a/llvm/test/tools/yaml2obj/elf-comdat-broken-info.yaml b/llvm/test/tools/yaml2obj/ELF/comdat-broken-info.yaml rename from llvm/test/tools/yaml2obj/elf-comdat-broken-info.yaml rename to llvm/test/tools/yaml2obj/ELF/comdat-broken-info.yaml diff --git a/llvm/test/tools/yaml2obj/elf-comdat-broken-members.yaml b/llvm/test/tools/yaml2obj/ELF/comdat-broken-members.yaml rename from llvm/test/tools/yaml2obj/elf-comdat-broken-members.yaml rename to llvm/test/tools/yaml2obj/ELF/comdat-broken-members.yaml diff --git a/llvm/test/tools/yaml2obj/elf-comdat-broken.yaml b/llvm/test/tools/yaml2obj/ELF/comdat-broken.yaml rename from llvm/test/tools/yaml2obj/elf-comdat-broken.yaml rename to llvm/test/tools/yaml2obj/ELF/comdat-broken.yaml diff --git a/llvm/test/tools/yaml2obj/custom-fill.yaml b/llvm/test/tools/yaml2obj/ELF/custom-fill.yaml rename from llvm/test/tools/yaml2obj/custom-fill.yaml rename to llvm/test/tools/yaml2obj/ELF/custom-fill.yaml diff --git a/llvm/test/tools/yaml2obj/elf-custom-null-section.yaml b/llvm/test/tools/yaml2obj/ELF/custom-null-section.yaml rename from llvm/test/tools/yaml2obj/elf-custom-null-section.yaml rename to llvm/test/tools/yaml2obj/ELF/custom-null-section.yaml diff --git a/llvm/test/tools/yaml2obj/duplicate-section-names.test b/llvm/test/tools/yaml2obj/ELF/duplicate-section-names.yaml rename from llvm/test/tools/yaml2obj/duplicate-section-names.test rename to llvm/test/tools/yaml2obj/ELF/duplicate-section-names.yaml --- a/llvm/test/tools/yaml2obj/duplicate-section-names.test +++ b/llvm/test/tools/yaml2obj/ELF/duplicate-section-names.yaml @@ -159,7 +159,7 @@ - Name: '.group [1]' Type: SHT_GROUP Info: 'foo [1]' - Members: + Members: - SectionOrType: GRP_COMDAT - SectionOrType: '.text.foo [1]' - Name: '.text.foo [1]' diff --git a/llvm/test/tools/yaml2obj/duplicate-symbol-names.test b/llvm/test/tools/yaml2obj/ELF/duplicate-symbol-names.yaml rename from llvm/test/tools/yaml2obj/duplicate-symbol-names.test rename to llvm/test/tools/yaml2obj/ELF/duplicate-symbol-names.yaml diff --git a/llvm/test/tools/yaml2obj/dynamic-relocations.yaml b/llvm/test/tools/yaml2obj/ELF/dynamic-relocations.yaml rename from llvm/test/tools/yaml2obj/dynamic-relocations.yaml rename to llvm/test/tools/yaml2obj/ELF/dynamic-relocations.yaml diff --git a/llvm/test/tools/yaml2obj/dynamic-section-i386.test b/llvm/test/tools/yaml2obj/ELF/dynamic-section-i386.yaml rename from llvm/test/tools/yaml2obj/dynamic-section-i386.test rename to llvm/test/tools/yaml2obj/ELF/dynamic-section-i386.yaml diff --git a/llvm/test/tools/yaml2obj/dynamic-section-raw-content.yaml b/llvm/test/tools/yaml2obj/ELF/dynamic-section-raw-content.yaml rename from llvm/test/tools/yaml2obj/dynamic-section-raw-content.yaml rename to llvm/test/tools/yaml2obj/ELF/dynamic-section-raw-content.yaml --- a/llvm/test/tools/yaml2obj/dynamic-section-raw-content.yaml +++ b/llvm/test/tools/yaml2obj/ELF/dynamic-section-raw-content.yaml @@ -1,5 +1,5 @@ -# Show that yaml2obj can handle a dynamic section with raw content instead of -# entries. Also show that it rejects raw content when entries are also provided. +## Show that yaml2obj can handle a dynamic section with raw content instead of +## entries. Also show that it rejects raw content when entries are also provided. # RUN: yaml2obj --docnum=1 %s -o %t1 # RUN: llvm-readobj -x .dynamic --sections %t1 | FileCheck %s --check-prefix=RAW diff --git a/llvm/test/tools/yaml2obj/dynamic-section.yaml b/llvm/test/tools/yaml2obj/ELF/dynamic-section.yaml rename from llvm/test/tools/yaml2obj/dynamic-section.yaml rename to llvm/test/tools/yaml2obj/ELF/dynamic-section.yaml --- a/llvm/test/tools/yaml2obj/dynamic-section.yaml +++ b/llvm/test/tools/yaml2obj/ELF/dynamic-section.yaml @@ -1,4 +1,5 @@ -# Ensures that dynamic section has sh_entsize correctly set +## Ensures that dynamic section has sh_entsize correctly set. + # RUN: yaml2obj %s -o %t # RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix=SECTION diff --git a/llvm/test/tools/yaml2obj/dynamic-symbols.yaml b/llvm/test/tools/yaml2obj/ELF/dynamic-symbols.yaml rename from llvm/test/tools/yaml2obj/dynamic-symbols.yaml rename to llvm/test/tools/yaml2obj/ELF/dynamic-symbols.yaml --- a/llvm/test/tools/yaml2obj/dynamic-symbols.yaml +++ b/llvm/test/tools/yaml2obj/ELF/dynamic-symbols.yaml @@ -51,12 +51,12 @@ # NUM-SAME: .data (0x1) # NUM: Name: bar -# NUM: Section: +# NUM: Section: # NUM-SAME: .strtab (0x2) # NUM: Name: zed # NUM: warning: '[[FILE]]': invalid section index: 255 -# NUM: Section: +# NUM: Section: # NUM-SAME: (0xFF) --- !ELF diff --git a/llvm/test/tools/yaml2obj/dynsymtab-implicit-sections-size-content.yaml b/llvm/test/tools/yaml2obj/ELF/dynsymtab-implicit-sections-size-content.yaml rename from llvm/test/tools/yaml2obj/dynsymtab-implicit-sections-size-content.yaml rename to llvm/test/tools/yaml2obj/ELF/dynsymtab-implicit-sections-size-content.yaml diff --git a/llvm/test/tools/yaml2obj/dynsymtab-shlink.yaml b/llvm/test/tools/yaml2obj/ELF/dynsymtab-shlink.yaml rename from llvm/test/tools/yaml2obj/dynsymtab-shlink.yaml rename to llvm/test/tools/yaml2obj/ELF/dynsymtab-shlink.yaml diff --git a/llvm/test/tools/yaml2obj/elf-emachine.yaml b/llvm/test/tools/yaml2obj/ELF/emachine.yaml rename from llvm/test/tools/yaml2obj/elf-emachine.yaml rename to llvm/test/tools/yaml2obj/ELF/emachine.yaml diff --git a/llvm/test/tools/yaml2obj/elf-ent-size.yaml b/llvm/test/tools/yaml2obj/ELF/ent-size.yaml rename from llvm/test/tools/yaml2obj/elf-ent-size.yaml rename to llvm/test/tools/yaml2obj/ELF/ent-size.yaml diff --git a/llvm/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yaml b/llvm/test/tools/yaml2obj/ELF/explicit-dynsym-no-dynstr.yaml rename from llvm/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yaml rename to llvm/test/tools/yaml2obj/ELF/explicit-dynsym-no-dynstr.yaml diff --git a/llvm/test/tools/yaml2obj/elf-gnu-hash-section.yaml b/llvm/test/tools/yaml2obj/ELF/gnu-hash-section.yaml rename from llvm/test/tools/yaml2obj/elf-gnu-hash-section.yaml rename to llvm/test/tools/yaml2obj/ELF/gnu-hash-section.yaml diff --git a/llvm/test/tools/yaml2obj/elf-gnu-unique-symbols.yaml b/llvm/test/tools/yaml2obj/ELF/gnu-unique-symbols.yaml rename from llvm/test/tools/yaml2obj/elf-gnu-unique-symbols.yaml rename to llvm/test/tools/yaml2obj/ELF/gnu-unique-symbols.yaml diff --git a/llvm/test/tools/yaml2obj/elf-hash-section.yaml b/llvm/test/tools/yaml2obj/ELF/hash-section.yaml rename from llvm/test/tools/yaml2obj/elf-hash-section.yaml rename to llvm/test/tools/yaml2obj/ELF/hash-section.yaml diff --git a/llvm/test/tools/yaml2obj/elf-header-elfdatanone.yaml b/llvm/test/tools/yaml2obj/ELF/header-elfdatanone.yaml rename from llvm/test/tools/yaml2obj/elf-header-elfdatanone.yaml rename to llvm/test/tools/yaml2obj/ELF/header-elfdatanone.yaml diff --git a/llvm/test/tools/yaml2obj/elf-header-sh-fields.yaml b/llvm/test/tools/yaml2obj/ELF/header-sh-fields.yaml rename from llvm/test/tools/yaml2obj/elf-header-sh-fields.yaml rename to llvm/test/tools/yaml2obj/ELF/header-sh-fields.yaml diff --git a/llvm/test/tools/yaml2obj/implicit-sections-addr.yaml b/llvm/test/tools/yaml2obj/ELF/implicit-sections-addr.yaml rename from llvm/test/tools/yaml2obj/implicit-sections-addr.yaml rename to llvm/test/tools/yaml2obj/ELF/implicit-sections-addr.yaml diff --git a/llvm/test/tools/yaml2obj/implicit-sections-info.yaml b/llvm/test/tools/yaml2obj/ELF/implicit-sections-info.yaml rename from llvm/test/tools/yaml2obj/implicit-sections-info.yaml rename to llvm/test/tools/yaml2obj/ELF/implicit-sections-info.yaml diff --git a/llvm/test/tools/yaml2obj/implicit-sections-types.test b/llvm/test/tools/yaml2obj/ELF/implicit-sections-types.yaml rename from llvm/test/tools/yaml2obj/implicit-sections-types.test rename to llvm/test/tools/yaml2obj/ELF/implicit-sections-types.yaml diff --git a/llvm/test/tools/yaml2obj/implicit-sections.test b/llvm/test/tools/yaml2obj/ELF/implicit-sections.yaml rename from llvm/test/tools/yaml2obj/implicit-sections.test rename to llvm/test/tools/yaml2obj/ELF/implicit-sections.yaml diff --git a/llvm/test/tools/yaml2obj/invalid-docnum.test b/llvm/test/tools/yaml2obj/ELF/invalid-docnum.yaml rename from llvm/test/tools/yaml2obj/invalid-docnum.test rename to llvm/test/tools/yaml2obj/ELF/invalid-docnum.yaml diff --git a/llvm/test/tools/yaml2obj/linker-options.yaml b/llvm/test/tools/yaml2obj/ELF/linker-options.yaml rename from llvm/test/tools/yaml2obj/linker-options.yaml rename to llvm/test/tools/yaml2obj/ELF/linker-options.yaml --- a/llvm/test/tools/yaml2obj/linker-options.yaml +++ b/llvm/test/tools/yaml2obj/ELF/linker-options.yaml @@ -86,7 +86,7 @@ # RUN: not yaml2obj %s --docnum=4 2>&1 | FileCheck %s --check-prefix=BOTH # BOTH: error: "Options" and "Content" can't be used together - + --- !ELF FileHeader: Class: ELFCLASS64 diff --git a/llvm/test/tools/yaml2obj/elf-llvm-addrsig-section.yaml b/llvm/test/tools/yaml2obj/ELF/llvm-addrsig-section.yaml rename from llvm/test/tools/yaml2obj/elf-llvm-addrsig-section.yaml rename to llvm/test/tools/yaml2obj/ELF/llvm-addrsig-section.yaml diff --git a/llvm/test/tools/yaml2obj/local-symbols.yaml b/llvm/test/tools/yaml2obj/ELF/local-symbols.yaml rename from llvm/test/tools/yaml2obj/local-symbols.yaml rename to llvm/test/tools/yaml2obj/ELF/local-symbols.yaml --- a/llvm/test/tools/yaml2obj/local-symbols.yaml +++ b/llvm/test/tools/yaml2obj/ELF/local-symbols.yaml @@ -1,6 +1,6 @@ -# Check we correctly set the sh_info field of .symtab section. -# A symbol table section's sh_info section header member holds -# the symbol table index for the first non-local symbol. +## Check we correctly set the sh_info field of .symtab section. +## A symbol table section's sh_info section header member holds +## the symbol table index for the first non-local symbol. # RUN: yaml2obj -docnum=1 %s -o %t # RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix=ONE diff --git a/llvm/test/tools/yaml2obj/elf-no-phdrs.yaml b/llvm/test/tools/yaml2obj/ELF/no-phdrs.yaml rename from llvm/test/tools/yaml2obj/elf-no-phdrs.yaml rename to llvm/test/tools/yaml2obj/ELF/no-phdrs.yaml diff --git a/llvm/test/tools/yaml2obj/elf-override-shname.yaml b/llvm/test/tools/yaml2obj/ELF/override-shname.yaml rename from llvm/test/tools/yaml2obj/elf-override-shname.yaml rename to llvm/test/tools/yaml2obj/ELF/override-shname.yaml diff --git a/llvm/test/tools/yaml2obj/elf-override-shoffset.yaml b/llvm/test/tools/yaml2obj/ELF/override-shoffset.yaml rename from llvm/test/tools/yaml2obj/elf-override-shoffset.yaml rename to llvm/test/tools/yaml2obj/ELF/override-shoffset.yaml diff --git a/llvm/test/tools/yaml2obj/elf-override-shsize.yaml b/llvm/test/tools/yaml2obj/ELF/override-shsize.yaml rename from llvm/test/tools/yaml2obj/elf-override-shsize.yaml rename to llvm/test/tools/yaml2obj/ELF/override-shsize.yaml --- a/llvm/test/tools/yaml2obj/elf-override-shsize.yaml +++ b/llvm/test/tools/yaml2obj/ELF/override-shsize.yaml @@ -5,7 +5,7 @@ # RUN: llvm-readelf --sections %t1 | FileCheck %s --check-prefix=CASE1 # CASE1: Section Headers: -# CASE1-NEXT: [Nr] Name Type Address Off Size +# CASE1-NEXT: [Nr] Name Type Address Off Size # CASE1-NEXT: [ 0] NULL 0000000000000000 000000 000000 # CASE1-NEXT: [ 1] .dynsym DYNSYM 0000000000000000 000040 000001 # CASE1-NEXT: [ 2] .symtab SYMTAB 0000000000000000 000058 000002 diff --git a/llvm/test/tools/yaml2obj/program-header-align.yaml b/llvm/test/tools/yaml2obj/ELF/program-header-align.yaml rename from llvm/test/tools/yaml2obj/program-header-align.yaml rename to llvm/test/tools/yaml2obj/ELF/program-header-align.yaml diff --git a/llvm/test/tools/yaml2obj/program-header-nobits.yaml b/llvm/test/tools/yaml2obj/ELF/program-header-nobits.yaml rename from llvm/test/tools/yaml2obj/program-header-nobits.yaml rename to llvm/test/tools/yaml2obj/ELF/program-header-nobits.yaml diff --git a/llvm/test/tools/yaml2obj/program-header-size-offset.yaml b/llvm/test/tools/yaml2obj/ELF/program-header-size-offset.yaml rename from llvm/test/tools/yaml2obj/program-header-size-offset.yaml rename to llvm/test/tools/yaml2obj/ELF/program-header-size-offset.yaml --- a/llvm/test/tools/yaml2obj/program-header-size-offset.yaml +++ b/llvm/test/tools/yaml2obj/ELF/program-header-size-offset.yaml @@ -1,5 +1,5 @@ -# Show that yaml2obj properly emits program headers with explicit file size, -# memory size and offset parameters. +## Show that yaml2obj properly emits program headers with explicit file size, +## memory size and offset parameters. # RUN: yaml2obj %s -o %t # RUN: llvm-readobj %t --program-headers | FileCheck %s diff --git a/llvm/test/tools/yaml2obj/program-header.yaml b/llvm/test/tools/yaml2obj/ELF/program-header.yaml rename from llvm/test/tools/yaml2obj/program-header.yaml rename to llvm/test/tools/yaml2obj/ELF/program-header.yaml diff --git a/llvm/test/tools/yaml2obj/reloc-sec-info.yaml b/llvm/test/tools/yaml2obj/ELF/reloc-sec-info.yaml rename from llvm/test/tools/yaml2obj/reloc-sec-info.yaml rename to llvm/test/tools/yaml2obj/ELF/reloc-sec-info.yaml diff --git a/llvm/test/tools/yaml2obj/relocation-explicit-symbol-index.yaml b/llvm/test/tools/yaml2obj/ELF/relocation-explicit-symbol-index.yaml rename from llvm/test/tools/yaml2obj/relocation-explicit-symbol-index.yaml rename to llvm/test/tools/yaml2obj/ELF/relocation-explicit-symbol-index.yaml --- a/llvm/test/tools/yaml2obj/relocation-explicit-symbol-index.yaml +++ b/llvm/test/tools/yaml2obj/ELF/relocation-explicit-symbol-index.yaml @@ -1,7 +1,8 @@ -# Test that a relocation's symbol can be an integer. -# RUN: yaml2obj %s > %t -# LLVM tools (both llvm-readobj and llvm-objdump) reject relocations with -# invalid symbol indexes, so inspect the hex contents instead. +## Test that a relocation's symbol can be an integer (symbol index). + +# RUN: yaml2obj %s -o %t +## LLVM tools (both llvm-readobj and llvm-objdump) reject relocations with +## invalid symbol indexes, so inspect the hex contents instead. # RUN: llvm-readobj -x .rela.text %t | FileCheck %s # CHECK: Hex dump of section '.rela.text': diff --git a/llvm/test/tools/yaml2obj/invalid-symboless-relocation.yaml b/llvm/test/tools/yaml2obj/ELF/relocation-implicit-symbol-index.yaml rename from llvm/test/tools/yaml2obj/invalid-symboless-relocation.yaml rename to llvm/test/tools/yaml2obj/ELF/relocation-implicit-symbol-index.yaml --- a/llvm/test/tools/yaml2obj/invalid-symboless-relocation.yaml +++ b/llvm/test/tools/yaml2obj/ELF/relocation-implicit-symbol-index.yaml @@ -1,8 +1,15 @@ -# This test succeeds but produces an invalid relocation. This test -# documents this behavoir. -# RUN: yaml2obj %s > %t +## If "Symbol" is not specified for a relocation, the symbol index is assumed to be 0. + +# RUN: yaml2obj %s -o %t # RUN: llvm-readobj -r %t | FileCheck %s +# CHECK: Relocations [ +# CHECK-NEXT: Section (2) .rel.text { +# CHECK-NEXT: 0x1000 R_X86_64_RELATIVE - 0x0 +# CHECK-NEXT: 0x1001 R_X86_64_PC32 - 0x0 +# CHECK-NEXT: } +# CHECK-NEXT:] + !ELF FileHeader: Class: ELFCLASS64 @@ -19,10 +26,7 @@ Info: .text Relocations: - Offset: 0x1000 + Type: R_X86_64_RELATIVE + ## R_X86_64_PC32 should have a non-zero symbol index but we don't error. + - Offset: 0x1001 Type: R_X86_64_PC32 - -#CHECK: Relocations [ -#CHECK-NEXT: Section (2) .rel.text { -#CHECK-NEXT: 0x1000 R_X86_64_PC32 - 0x0 -#CHECK-NEXT: } -#CHECK-NEXT:] diff --git a/llvm/test/tools/yaml2obj/relocation-missing-symbol.yaml b/llvm/test/tools/yaml2obj/ELF/relocation-missing-symbol.yaml rename from llvm/test/tools/yaml2obj/relocation-missing-symbol.yaml rename to llvm/test/tools/yaml2obj/ELF/relocation-missing-symbol.yaml diff --git a/llvm/test/tools/yaml2obj/relocation-unsupported-machine.yaml b/llvm/test/tools/yaml2obj/ELF/relocation-unsupported-machine.yaml rename from llvm/test/tools/yaml2obj/relocation-unsupported-machine.yaml rename to llvm/test/tools/yaml2obj/ELF/relocation-unsupported-machine.yaml diff --git a/llvm/test/tools/yaml2obj/section-link.yaml b/llvm/test/tools/yaml2obj/ELF/section-link.yaml rename from llvm/test/tools/yaml2obj/section-link.yaml rename to llvm/test/tools/yaml2obj/ELF/section-link.yaml diff --git a/llvm/test/tools/yaml2obj/section-ordering.yaml b/llvm/test/tools/yaml2obj/ELF/section-ordering.yaml rename from llvm/test/tools/yaml2obj/section-ordering.yaml rename to llvm/test/tools/yaml2obj/ELF/section-ordering.yaml --- a/llvm/test/tools/yaml2obj/section-ordering.yaml +++ b/llvm/test/tools/yaml2obj/ELF/section-ordering.yaml @@ -1,4 +1,5 @@ -# Ensures that implicitly added sections can be ordered within Sections. +## Ensures that implicitly added sections can be ordered within Sections. + # RUN: yaml2obj %s -o %t # RUN: llvm-readobj --sections %t | FileCheck %s diff --git a/llvm/test/tools/yaml2obj/section-size-content.yaml b/llvm/test/tools/yaml2obj/ELF/section-size-content.yaml rename from llvm/test/tools/yaml2obj/section-size-content.yaml rename to llvm/test/tools/yaml2obj/ELF/section-size-content.yaml diff --git a/llvm/test/tools/yaml2obj/section-type.yaml b/llvm/test/tools/yaml2obj/ELF/section-type.yaml rename from llvm/test/tools/yaml2obj/section-type.yaml rename to llvm/test/tools/yaml2obj/ELF/section-type.yaml diff --git a/llvm/test/tools/yaml2obj/unnamed-section.yaml b/llvm/test/tools/yaml2obj/ELF/section-unnamed.yaml rename from llvm/test/tools/yaml2obj/unnamed-section.yaml rename to llvm/test/tools/yaml2obj/ELF/section-unnamed.yaml --- a/llvm/test/tools/yaml2obj/unnamed-section.yaml +++ b/llvm/test/tools/yaml2obj/ELF/section-unnamed.yaml @@ -1,4 +1,5 @@ -# Ensure yaml2obj doesn't crash on unnamed sections +## Check that "Name" defaults to an empty string. + # RUN: yaml2obj %s -o %t # RUN: llvm-readobj --sections %t | FileCheck %s diff --git a/llvm/test/tools/yaml2obj/elf-sh-addralign.yaml b/llvm/test/tools/yaml2obj/ELF/sh-addralign.yaml rename from llvm/test/tools/yaml2obj/elf-sh-addralign.yaml rename to llvm/test/tools/yaml2obj/ELF/sh-addralign.yaml --- a/llvm/test/tools/yaml2obj/elf-sh-addralign.yaml +++ b/llvm/test/tools/yaml2obj/ELF/sh-addralign.yaml @@ -1,6 +1,6 @@ ## Check that yaml2obj takes in account section AddressAlign field. -# RUN: yaml2obj %s > %t +# RUN: yaml2obj %s -o %t # RUN: llvm-readobj -S %t | FileCheck %s # CHECK: Section { diff --git a/llvm/test/tools/yaml2obj/elf-sht-symtab-shndx.yaml b/llvm/test/tools/yaml2obj/ELF/sht-symtab-shndx.yaml rename from llvm/test/tools/yaml2obj/elf-sht-symtab-shndx.yaml rename to llvm/test/tools/yaml2obj/ELF/sht-symtab-shndx.yaml --- a/llvm/test/tools/yaml2obj/elf-sht-symtab-shndx.yaml +++ b/llvm/test/tools/yaml2obj/ELF/sht-symtab-shndx.yaml @@ -21,7 +21,7 @@ Index: SHN_XINDEX ## Check that yaml2obj keeps the SHT_SYMTAB_SHNDX section in the output -## even when symbol's section index value is low enough to not require the extended symtab. +## even when symbol's section index value is low enough to not require the extended symtab. ## Also, check that symbols in .symtab still have the SHN_XINDEX index. # RUN: yaml2obj --docnum=2 %s -o %t2 diff --git a/llvm/test/tools/yaml2obj/elf-stack-sizes.yaml b/llvm/test/tools/yaml2obj/ELF/stack-sizes.yaml rename from llvm/test/tools/yaml2obj/elf-stack-sizes.yaml rename to llvm/test/tools/yaml2obj/ELF/stack-sizes.yaml diff --git a/llvm/test/tools/yaml2obj/strtab-implicit-sections-flags.yaml b/llvm/test/tools/yaml2obj/ELF/strtab-implicit-sections-flags.yaml rename from llvm/test/tools/yaml2obj/strtab-implicit-sections-flags.yaml rename to llvm/test/tools/yaml2obj/ELF/strtab-implicit-sections-flags.yaml diff --git a/llvm/test/tools/yaml2obj/strtab-implicit-sections-size-content.yaml b/llvm/test/tools/yaml2obj/ELF/strtab-implicit-sections-size-content.yaml rename from llvm/test/tools/yaml2obj/strtab-implicit-sections-size-content.yaml rename to llvm/test/tools/yaml2obj/ELF/strtab-implicit-sections-size-content.yaml diff --git a/llvm/test/tools/yaml2obj/elf-symbol-binding.yaml b/llvm/test/tools/yaml2obj/ELF/symbol-binding.yaml rename from llvm/test/tools/yaml2obj/elf-symbol-binding.yaml rename to llvm/test/tools/yaml2obj/ELF/symbol-binding.yaml diff --git a/llvm/test/tools/yaml2obj/symbol-index-invalid.yaml b/llvm/test/tools/yaml2obj/ELF/symbol-index-invalid.yaml rename from llvm/test/tools/yaml2obj/symbol-index-invalid.yaml rename to llvm/test/tools/yaml2obj/ELF/symbol-index-invalid.yaml --- a/llvm/test/tools/yaml2obj/symbol-index-invalid.yaml +++ b/llvm/test/tools/yaml2obj/ELF/symbol-index-invalid.yaml @@ -1,4 +1,5 @@ -# This test insures that the user cannot have both an Index and a Section field. +## Check that "Index" and "Section" cannot be used together. + # RUN: not yaml2obj %s !ELF diff --git a/llvm/test/tools/yaml2obj/symbol-index.yaml b/llvm/test/tools/yaml2obj/ELF/symbol-index.yaml rename from llvm/test/tools/yaml2obj/symbol-index.yaml rename to llvm/test/tools/yaml2obj/ELF/symbol-index.yaml --- a/llvm/test/tools/yaml2obj/symbol-index.yaml +++ b/llvm/test/tools/yaml2obj/ELF/symbol-index.yaml @@ -1,4 +1,4 @@ -# RUN: yaml2obj %s > %t +# RUN: yaml2obj %s -o %t # RUN: llvm-readelf -s %t | FileCheck %s !ELF @@ -21,10 +21,10 @@ Binding: STB_GLOBAL - Name: common1 Index: SHN_COMMON - Binding: STB_GLOBAL + Binding: STB_GLOBAL - Name: common2 Index: 0xfff2 - Binding: STB_GLOBAL + Binding: STB_GLOBAL - Name: good Index: 0x1 Binding: STB_GLOBAL diff --git a/llvm/test/tools/yaml2obj/symbol-name.yaml b/llvm/test/tools/yaml2obj/ELF/symbol-name.yaml rename from llvm/test/tools/yaml2obj/symbol-name.yaml rename to llvm/test/tools/yaml2obj/ELF/symbol-name.yaml diff --git a/llvm/test/tools/yaml2obj/elf-symbol-stother.yaml b/llvm/test/tools/yaml2obj/ELF/symbol-stother.yaml rename from llvm/test/tools/yaml2obj/elf-symbol-stother.yaml rename to llvm/test/tools/yaml2obj/ELF/symbol-stother.yaml diff --git a/llvm/test/tools/yaml2obj/symbol-type.yaml b/llvm/test/tools/yaml2obj/ELF/symbol-type.yaml rename from llvm/test/tools/yaml2obj/symbol-type.yaml rename to llvm/test/tools/yaml2obj/ELF/symbol-type.yaml --- a/llvm/test/tools/yaml2obj/symbol-type.yaml +++ b/llvm/test/tools/yaml2obj/ELF/symbol-type.yaml @@ -1,4 +1,4 @@ -# RUN: yaml2obj %s > %t +# RUN: yaml2obj %s -o %t # RUN: llvm-readobj --symbols %t | FileCheck %s # CHECK: Name: notype @@ -30,7 +30,7 @@ Symbols: - Name: notype Type: STT_NOTYPE - Binding: STB_GLOBAL + Binding: STB_GLOBAL - Name: normal_type Type: STT_OBJECT Binding: STB_GLOBAL diff --git a/llvm/test/tools/yaml2obj/elf-symbol-visibility.yaml b/llvm/test/tools/yaml2obj/ELF/symbol-visibility.yaml rename from llvm/test/tools/yaml2obj/elf-symbol-visibility.yaml rename to llvm/test/tools/yaml2obj/ELF/symbol-visibility.yaml diff --git a/llvm/test/tools/yaml2obj/elf-symbols-binding-order.yaml b/llvm/test/tools/yaml2obj/ELF/symbols-binding-order.yaml rename from llvm/test/tools/yaml2obj/elf-symbols-binding-order.yaml rename to llvm/test/tools/yaml2obj/ELF/symbols-binding-order.yaml diff --git a/llvm/test/tools/yaml2obj/symtab-implicit-sections-flags.yaml b/llvm/test/tools/yaml2obj/ELF/symtab-implicit-sections-flags.yaml rename from llvm/test/tools/yaml2obj/symtab-implicit-sections-flags.yaml rename to llvm/test/tools/yaml2obj/ELF/symtab-implicit-sections-flags.yaml diff --git a/llvm/test/tools/yaml2obj/symtab-implicit-sections-size-content.yaml b/llvm/test/tools/yaml2obj/ELF/symtab-implicit-sections-size-content.yaml rename from llvm/test/tools/yaml2obj/symtab-implicit-sections-size-content.yaml rename to llvm/test/tools/yaml2obj/ELF/symtab-implicit-sections-size-content.yaml diff --git a/llvm/test/tools/yaml2obj/elf-symtab-shinfo.yaml b/llvm/test/tools/yaml2obj/ELF/symtab-shinfo.yaml rename from llvm/test/tools/yaml2obj/elf-symtab-shinfo.yaml rename to llvm/test/tools/yaml2obj/ELF/symtab-shinfo.yaml --- a/llvm/test/tools/yaml2obj/elf-symtab-shinfo.yaml +++ b/llvm/test/tools/yaml2obj/ELF/symtab-shinfo.yaml @@ -21,7 +21,7 @@ # CHECK-NEXT: Size: # CHECK-NEXT: Link: # CHECK-NEXT: Info: 26 - + --- !ELF FileHeader: Class: ELFCLASS64 diff --git a/llvm/test/tools/yaml2obj/symtab-shlink.yaml b/llvm/test/tools/yaml2obj/ELF/symtab-shlink.yaml rename from llvm/test/tools/yaml2obj/symtab-shlink.yaml rename to llvm/test/tools/yaml2obj/ELF/symtab-shlink.yaml diff --git a/llvm/test/tools/yaml2obj/elf-symtab-shtype.yaml b/llvm/test/tools/yaml2obj/ELF/symtab-shtype.yaml rename from llvm/test/tools/yaml2obj/elf-symtab-shtype.yaml rename to llvm/test/tools/yaml2obj/ELF/symtab-shtype.yaml diff --git a/llvm/test/tools/yaml2obj/verdef-section.yaml b/llvm/test/tools/yaml2obj/ELF/verdef-section.yaml rename from llvm/test/tools/yaml2obj/verdef-section.yaml rename to llvm/test/tools/yaml2obj/ELF/verdef-section.yaml --- a/llvm/test/tools/yaml2obj/verdef-section.yaml +++ b/llvm/test/tools/yaml2obj/ELF/verdef-section.yaml @@ -1,8 +1,8 @@ +## Check we are able to handle the SHT_GNU_verdef sections. + # RUN: yaml2obj %s -o %t # RUN: llvm-readobj -V %t | FileCheck %s -# Check we are able to handle the SHT_GNU_verdef sections. - # CHECK: VersionDefinitions [ # CHECK-NEXT: Definition { # CHECK-NEXT: Version: 1 diff --git a/llvm/test/tools/yaml2obj/verneed-section.yaml b/llvm/test/tools/yaml2obj/ELF/verneed-section.yaml rename from llvm/test/tools/yaml2obj/verneed-section.yaml rename to llvm/test/tools/yaml2obj/ELF/verneed-section.yaml --- a/llvm/test/tools/yaml2obj/verneed-section.yaml +++ b/llvm/test/tools/yaml2obj/ELF/verneed-section.yaml @@ -1,8 +1,8 @@ +## Check we are able to handle the SHT_GNU_verneed sections. + # RUN: yaml2obj %s -o %t # RUN: llvm-readobj -V %t | FileCheck %s -# Check we are able to handle the SHT_GNU_verneed sections. - # CHECK: VersionRequirements [ # CHECK-NEXT: Dependency { # CHECK-NEXT: Version: 1 diff --git a/llvm/test/tools/yaml2obj/versym-section.yaml b/llvm/test/tools/yaml2obj/ELF/versym-section.yaml rename from llvm/test/tools/yaml2obj/versym-section.yaml rename to llvm/test/tools/yaml2obj/ELF/versym-section.yaml --- a/llvm/test/tools/yaml2obj/versym-section.yaml +++ b/llvm/test/tools/yaml2obj/ELF/versym-section.yaml @@ -68,7 +68,7 @@ Dependencies: - Version: 1 File: dso.so.0 - Entries: + Entries: - Name: v1 Hash: 1937 Flags: 0 diff --git a/llvm/test/tools/yaml2obj/minidump-exception-missing-parameter.yaml b/llvm/test/tools/yaml2obj/Minidump/exception-missing-parameter.yaml rename from llvm/test/tools/yaml2obj/minidump-exception-missing-parameter.yaml rename to llvm/test/tools/yaml2obj/Minidump/exception-missing-parameter.yaml diff --git a/llvm/test/tools/yaml2obj/minidump-raw-stream-small-size.yaml b/llvm/test/tools/yaml2obj/Minidump/raw-stream-small-size.yaml rename from llvm/test/tools/yaml2obj/minidump-raw-stream-small-size.yaml rename to llvm/test/tools/yaml2obj/Minidump/raw-stream-small-size.yaml diff --git a/llvm/test/tools/yaml2obj/minidump-systeminfo-other-long.yaml b/llvm/test/tools/yaml2obj/Minidump/systeminfo-other-long.yaml rename from llvm/test/tools/yaml2obj/minidump-systeminfo-other-long.yaml rename to llvm/test/tools/yaml2obj/Minidump/systeminfo-other-long.yaml diff --git a/llvm/test/tools/yaml2obj/minidump-systeminfo-other-not-hex.yaml b/llvm/test/tools/yaml2obj/Minidump/systeminfo-other-not-hex.yaml rename from llvm/test/tools/yaml2obj/minidump-systeminfo-other-not-hex.yaml rename to llvm/test/tools/yaml2obj/Minidump/systeminfo-other-not-hex.yaml diff --git a/llvm/test/tools/yaml2obj/minidump-systeminfo-other-short.yaml b/llvm/test/tools/yaml2obj/Minidump/systeminfo-other-short.yaml rename from llvm/test/tools/yaml2obj/minidump-systeminfo-other-short.yaml rename to llvm/test/tools/yaml2obj/Minidump/systeminfo-other-short.yaml diff --git a/llvm/test/tools/yaml2obj/minidump-systeminfo-x86-long.yaml b/llvm/test/tools/yaml2obj/Minidump/systeminfo-x86-long.yaml rename from llvm/test/tools/yaml2obj/minidump-systeminfo-x86-long.yaml rename to llvm/test/tools/yaml2obj/Minidump/systeminfo-x86-long.yaml diff --git a/llvm/test/tools/yaml2obj/minidump-systeminfo-x86-short.yaml b/llvm/test/tools/yaml2obj/Minidump/systeminfo-x86-short.yaml rename from llvm/test/tools/yaml2obj/minidump-systeminfo-x86-short.yaml rename to llvm/test/tools/yaml2obj/Minidump/systeminfo-x86-short.yaml diff --git a/llvm/test/tools/yaml2obj/empty-symbols.yaml b/llvm/test/tools/yaml2obj/empty-symbols.yaml deleted file mode 100644 --- a/llvm/test/tools/yaml2obj/empty-symbols.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# Ensure yaml2obj doesn't error on empty optional mappings, such as Symbols -# RUN: yaml2obj %s -o %t - -!ELF -FileHeader: - Class: ELFCLASS64 - Data: ELFDATA2LSB - Type: ET_DYN - Machine: EM_X86_64 -Symbols: diff --git a/llvm/test/tools/yaml2obj/invalid_output_file.test b/llvm/test/tools/yaml2obj/invalid-output-file.yaml rename from llvm/test/tools/yaml2obj/invalid_output_file.test rename to llvm/test/tools/yaml2obj/invalid-output-file.yaml --- a/llvm/test/tools/yaml2obj/invalid_output_file.test +++ b/llvm/test/tools/yaml2obj/invalid-output-file.yaml @@ -1,4 +1,4 @@ # RUN: not yaml2obj -o %p/path/does/not/exist 2>&1 | FileCheck %s -# Don't check the OS-dependent message "No such file or directory". +## Don't check the OS-dependent message "No such file or directory". # CHECK: yaml2obj: error: failed to open '{{.*}}/path/does/not/exist': {{.*}} diff --git a/llvm/test/tools/yaml2obj/multi-doc.test b/llvm/test/tools/yaml2obj/multi-doc.yaml rename from llvm/test/tools/yaml2obj/multi-doc.test rename to llvm/test/tools/yaml2obj/multi-doc.yaml diff --git a/llvm/test/tools/yaml2obj/symboless-relocation.yaml b/llvm/test/tools/yaml2obj/symboless-relocation.yaml deleted file mode 100644 --- a/llvm/test/tools/yaml2obj/symboless-relocation.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Just make sure this isn't an error even though it has no Symbol -# RUN: yaml2obj %s - -!ELF -FileHeader: - Class: ELFCLASS64 - Data: ELFDATA2LSB - Type: ET_EXEC - Machine: EM_X86_64 -Sections: - - Name: .text - Type: SHT_PROGBITS - Flags: [ SHF_ALLOC, SHF_EXECINSTR ] - Content: "00000000" - - Name: .rel.text - Type: SHT_REL - Info: .text - Relocations: - - Offset: 0x1000 - Type: R_X86_64_RELATIVE