## Check obj2yaml is able to decode all PPC64 relocations.

# RUN: yaml2obj %s -o %t
# RUN: obj2yaml %t | FileCheck %s

# CHECK:      --- !ELF
# CHECK-NEXT: FileHeader:
# CHECK-NEXT:   Class:   ELFCLASS64
# CHECK-NEXT:   Data:    ELFDATA2MSB
# CHECK-NEXT:   Type:    ET_REL
# CHECK-NEXT:   Machine: EM_PPC64
# CHECK-NEXT: Sections:
# CHECK-NEXT:   - Name:    .rela.text
# CHECK-NEXT:     Type:    SHT_RELA
# CHECK-NEXT:     EntSize: 0x0000000000000018
# CHECK-NEXT:     Relocations:
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_NONE
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR32
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR24
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_LO
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_HA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR14
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR14_BRTAKEN
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR14_BRNTAKEN
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL24
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL14
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL14_BRTAKEN
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL14_BRNTAKEN
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT16
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT16_LO
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT16_HA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GLOB_DAT
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_JMP_SLOT
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_RELATIVE
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL32
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR64
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_HIGHER
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_HIGHERA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_HIGHEST
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_HIGHESTA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL64
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TOC16
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TOC16_LO
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TOC16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TOC16_HA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TOC
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_LO_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT16_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT16_LO_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TOC16_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TOC16_LO_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TLS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPMOD64
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_LO
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_HA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL64
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_LO
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_HA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL64
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TLSGD16
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TLSGD16_LO
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TLSGD16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TLSGD16_HA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TLSLD16
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TLSLD16_LO
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TLSLD16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TLSLD16_HA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TPREL16_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TPREL16_LO_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TPREL16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_TPREL16_HA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_DTPREL16_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_DTPREL16_LO_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_DTPREL16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_GOT_DTPREL16_HA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_LO_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_HIGHER
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_HIGHERA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_HIGHEST
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_HIGHESTA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_LO_DS
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_HIGHER
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_HIGHERA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_HIGHEST
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_HIGHESTA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TLSGD
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TLSLD
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_HIGH
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_ADDR16_HIGHA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_HIGH
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_TPREL16_HIGHA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_HIGH
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_DTPREL16_HIGHA
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_IRELATIVE
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL16
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL16_LO
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL16_HI
# CHECK-NEXT:       - Offset: 0x0000000000000000
# CHECK-NEXT:         Type:   R_PPC64_REL16_HA

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2MSB
  Type:    ET_REL
  Machine: EM_PPC64
Sections:
  - Name: .rela.text
    Type: SHT_RELA
    Relocations:
      - Offset: 0x0000000000000000
        Type:   R_PPC64_NONE
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR32
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR24
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_LO
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_HA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR14
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR14_BRTAKEN
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR14_BRNTAKEN
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL24
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL14
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL14_BRTAKEN
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL14_BRNTAKEN
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT16
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT16_LO
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT16_HA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GLOB_DAT
      - Offset: 0x0000000000000000
        Type:   R_PPC64_JMP_SLOT
      - Offset: 0x0000000000000000
        Type:   R_PPC64_RELATIVE
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL32
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR64
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_HIGHER
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_HIGHERA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_HIGHEST
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_HIGHESTA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL64
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TOC16
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TOC16_LO
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TOC16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TOC16_HA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TOC
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_LO_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT16_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT16_LO_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TOC16_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TOC16_LO_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TLS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPMOD64
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_LO
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_HA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL64
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_LO
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_HA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL64
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TLSGD16
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TLSGD16_LO
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TLSGD16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TLSGD16_HA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TLSLD16
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TLSLD16_LO
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TLSLD16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TLSLD16_HA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TPREL16_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TPREL16_LO_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TPREL16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_TPREL16_HA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_DTPREL16_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_DTPREL16_LO_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_DTPREL16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_GOT_DTPREL16_HA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_LO_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_HIGHER
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_HIGHERA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_HIGHEST
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_HIGHESTA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_LO_DS
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_HIGHER
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_HIGHERA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_HIGHEST
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_HIGHESTA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TLSGD
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TLSLD
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_HIGH
      - Offset: 0x0000000000000000
        Type:   R_PPC64_ADDR16_HIGHA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_HIGH
      - Offset: 0x0000000000000000
        Type:   R_PPC64_TPREL16_HIGHA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_HIGH
      - Offset: 0x0000000000000000
        Type:   R_PPC64_DTPREL16_HIGHA
      - Offset: 0x0000000000000000
        Type:   R_PPC64_IRELATIVE
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL16
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL16_LO
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL16_HI
      - Offset: 0x0000000000000000
        Type:   R_PPC64_REL16_HA
