[PATCH] D96602: [llvm-nm][test] Add additional test coverage for llvm-nm options

Xing GUO via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 07:23:32 PST 2021


Higuoxing accepted this revision.
Higuoxing added a comment.
This revision is now accepted and ready to land.

I only have one inline comment. Otherwise LGTM :)



================
Comment at: llvm/test/tools/llvm-nm/reverse-sort.test:4-5
+# RUN: llvm-nm %t.o --reverse-sort | FileCheck %s --check-prefix=SORTED
+# RUN: llvm-nm %t.o --reverse-sort --numeric-sort | FileCheck %s --check-prefix=SORTED
+# RUN: llvm-nm %t.o --reverse-sort --size-sort | FileCheck %s --check-prefix=SORTED
+# RUN: llvm-nm %t.o --reverse-sort --no-sort | FileCheck %s --check-prefix=UNSORTED
----------------
I think it might be good to assign different values to symbol size and value. e.g.,

```
  - Name:    second
    Section: .text
    Value:   2
    Size:    3
  - Name:    third
    Section: .text
    Value:   3
    Size:    1
  - Name:    first
    Section: .text
    Value:   1
    Size:    2
```

to show that symbols are sorted by their address or size when --numeric-sort or --size-sort option is applied.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96602/new/

https://reviews.llvm.org/D96602



More information about the llvm-commits mailing list