llvm/llvm/test/tools/llvm-readobj/ELF/symbol-types.test

# Show that llvm-readobj can print the type of symbol for all known symbol types
# and also for unknown types, both in the os/processor specific ranges and not,
# for both GNU and LLVM styles.

# RUN: yaml2obj %s -o %t
# RUN: llvm-readobj --symbols %t | FileCheck %s --check-prefix=LLVM
# RUN: llvm-readelf --symbols %t | FileCheck %s --check-prefix=GNU

# LLVM: Name: notype
# LLVM: Type: None
# LLVM: Name: object
# LLVM: Type: Object
# LLVM: Name: func
# LLVM: Type: Function
# LLVM: Name: .text
# LLVM: Type: Section
# LLVM: Name: file
# LLVM: Type: File
# LLVM: Name: common
# LLVM: Type: Common
# LLVM: Name: tls
# LLVM: Type: TLS
# LLVM: Name: gnu_ifunc
# LLVM: Type: GNU_IFunc

# LLVM: Name: os_specific_11
# LLVM: Type: OS Specific (0xB)
# LLVM: Name: os_specific_12
# LLVM: Type: OS Specific (0xC)

# LLVM: Name: proc_specific_13
# LLVM: Type: Proc Specific (0xD)
# LLVM: Name: proc_specific_14
# LLVM: Type: Proc Specific (0xE)
# LLVM: Name: proc_specific_15
# LLVM: Type: Proc Specific (0xF)

# LLVM: Name: unknown_7
# LLVM: Type: Unknown (0x7)
# LLVM: Name: unknown_8
# LLVM: Type: Unknown (0x8)
# LLVM: Name: unknown_9
# LLVM: Type: Unknown (0x9)

# GNU: NOTYPE  {{.*}} notype
# GNU: OBJECT  {{.*}} object
# GNU: FUNC    {{.*}} func
# GNU: SECTION {{.*}} .text
# GNU: FILE    {{.*}} file
# GNU: COMMON  {{.*}} common
# GNU: TLS     {{.*}} tls
# GNU: IFUNC   {{.*}} gnu_ifunc
# GNU: <OS specific>: 11       {{.*}} os_specific_11
# GNU: <OS specific>: 12       {{.*}} os_specific_12
# GNU: <processor specific>: 13       {{.*}} proc_specific_13
# GNU: <processor specific>: 14       {{.*}} proc_specific_14
# GNU: <processor specific>: 15       {{.*}} proc_specific_15
# GNU: <unknown>: 7       {{.*}} unknown_7
# GNU: <unknown>: 8       {{.*}} unknown_8
# GNU: <unknown>: 9       {{.*}} unknown_9

!ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_REL
Sections:
  - Name: .text
    Type: SHT_PROGBITS
Symbols:
  - Name:    notype
    Type:    STT_NOTYPE
    Binding: STB_GLOBAL
  - Name:    object
    Type:    STT_OBJECT
    Binding: STB_GLOBAL
  - Name:    func
    Type:    STT_FUNC
    Binding: STB_GLOBAL
  - Name:    .text
    Type:    STT_SECTION
    Section: .text
    Binding: STB_GLOBAL
  - Name:    file
    Type:    STT_FILE
    Binding: STB_GLOBAL
  - Name:    common
    Type:    STT_COMMON
    Binding: STB_GLOBAL 
  - Name:    tls
    Type:    STT_TLS
    Binding: STB_GLOBAL
  - Name:    gnu_ifunc
    Type:    STT_GNU_IFUNC
    Binding: STB_GLOBAL
  - Name:    os_specific_11
    Type:    11
    Binding: STB_GLOBAL
  - Name:    os_specific_12
    Type:    12
    Binding: STB_GLOBAL
  - Name:    proc_specific_13
    Type:    13
    Binding: STB_GLOBAL
  - Name:    proc_specific_14
    Type:    14
    Binding: STB_GLOBAL
  - Name:    proc_specific_15
    Type:    15
    Binding: STB_GLOBAL
  - Name:    unknown_7
    Type:    7
    Binding: STB_GLOBAL
  - Name:    unknown_8
    Type:    8
    Binding: STB_GLOBAL
  - Name:    unknown_9
    Type:    9
    Binding: STB_GLOBAL