xref: /llvm-project/llvm/test/tools/llvm-nm/reverse-sort.test (revision 37c89803d860c6dd954cda1480dae6917f006972)
1## Show that the --reverse-sort option reverses the selected sort order.
2# RUN: yaml2obj %s -o %t.o
3# RUN: llvm-nm %t.o --reverse-sort | FileCheck %s --check-prefix=SORTED
4# RUN: llvm-nm %t.o --reverse-sort --numeric-sort | FileCheck %s --check-prefix=SORTED
5# RUN: llvm-nm %t.o --reverse-sort --size-sort | FileCheck %s --check-prefix=SORTED
6# RUN: llvm-nm %t.o --reverse-sort --no-sort | FileCheck %s --check-prefix=UNSORTED
7
8# SORTED:      third
9# SORTED-NEXT: second
10# SORTED-NEXT: first
11
12# UNSORTED:      second
13# UNSORTED-NEXT: third
14# UNSORTED-NEXT: first
15
16--- !ELF
17FileHeader:
18  Class:   ELFCLASS64
19  Data:    ELFDATA2LSB
20  Type:    ET_REL
21Sections:
22  - Name:  .text
23    Type:  SHT_PROGBITS
24    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
25Symbols:
26  - Name:    second
27    Section: .text
28    Value:   2
29    Size:    2
30  - Name:    third
31    Section: .text
32    Value:   3
33    Size:    3
34  - Name:    first
35    Section: .text
36    Value:   1
37    Size:    1
38