1# RUN: yaml2obj %s -o %t.o
2# RUN: llvm-nm %t.o | FileCheck %s --check-prefix=DEFAULT
3# RUN: llvm-nm --numeric-sort %t.o | FileCheck %s --check-prefix=NUMERIC
4# RUN: llvm-nm -n %t.o | FileCheck %s --check-prefix=NUMERIC
5# RUN: llvm-nm -v %t.o | FileCheck %s --check-prefix=NUMERIC
6
7!ELF
8FileHeader:
9  Class:   ELFCLASS64
10  Data:    ELFDATA2LSB
11  Type:    ET_REL
12  Machine: EM_X86_64
13Sections:
14  - Name: .text
15    Type: SHT_PROGBITS
16Symbols:
17  - Name:    symbol_a
18    Section: .text
19    Binding: STB_LOCAL
20    Value:   0x100
21  - Name:    symbol_b
22    Section: .text
23    Binding: STB_LOCAL
24    Value:   0x25
25  - Name:    symbol_d
26    Section: .text
27    Binding: STB_LOCAL
28    Value:   0x25
29  - Name:    symbol_c
30    Section: .text
31    Binding: STB_LOCAL
32    Value:   0x50
33
34# The default is to sort by symbol name.
35# DEFAULT:      0000000000000100 n symbol_a
36# DEFAULT-NEXT: 0000000000000025 n symbol_b
37# DEFAULT-NEXT: 0000000000000050 n symbol_c
38# DEFAULT-NEXT: 0000000000000025 n symbol_d
39
40# --numeric-sort sorts the symbols by value.
41# NUMERIC:      0000000000000025 n symbol_b
42# NUMERIC-NEXT: 0000000000000025 n symbol_d
43# NUMERIC-NEXT: 0000000000000050 n symbol_c
44# NUMERIC-NEXT: 0000000000000100 n symbol_a
45