File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,12 @@ static cl::opt<DynoStatsSortOrder> DynoStatsSortOrderOpt(
6060 " print-sorted-by-order" ,
6161 cl::desc (" use ascending or descending order when printing functions "
6262 " ordered by dyno stats" ),
63- cl::init(DynoStatsSortOrder::Descending), cl::cat(BoltOptCategory));
63+ cl::init(DynoStatsSortOrder::Descending),
64+ cl::values(clEnumValN(DynoStatsSortOrder::Ascending, " ascending" ,
65+ " Ascending order" ),
66+ clEnumValN(DynoStatsSortOrder::Descending, " descending" ,
67+ " Descending order" )),
68+ cl::cat(BoltOptCategory));
6469
6570cl::list<std::string>
6671HotTextMoveSections (" hot-text-move-sections" ,
Original file line number Diff line number Diff line change 1+ # Check th at -- print - sorted - by - order=<ascending/descending> option works properly in llvm - bolt
2+ #
3+ # RUN: llvm - mc - filetype=obj - triple aarch64 - unknown - unknown %s - o %t.o
4+ # RUN: %clang %cflags - fPIC - pie %t.o - o %t.exe - nostdlib - Wl ,- q
5+ # RUN: link_fdata %s %t.o %t.fdata
6+ # RUN: llvm - bolt %t.exe - o %t.bolt -- print - sorted - by=all -- print - sorted - by - order=ascending \
7+ # RUN: -- data %t.fdata | FileCheck %s - check - prefix=CHECK - ASCEND
8+ # RUN: llvm - bolt %t.exe - o %t.bolt -- print - sorted - by=all -- print - sorted - by - order=descending \
9+ # RUN: -- data %t.fdata | FileCheck %s - check - prefix=CHECK - DESCEND
10+
11+ # CHECK - ASCEND: BOLT - INFO: top functions sorted by dyno stats are:
12+ # CHECK - ASCEND - NEXT: bar
13+ # CHECK - ASCEND - NEXT: foo
14+ # CHECK - DESCEND: BOLT - INFO: top functions sorted by dyno stats are:
15+ # CHECK - DESCEND - NEXT: foo
16+ # CHECK - DESCEND - NEXT: bar
17+
18+ .text
19+ . align 4
20+ . global bar
21+ .type bar , %function
22+ bar:
23+ mov w0 , wzr
24+ ret
25+
26+ . global foo
27+ .type foo , %function
28+ foo:
29+ # FDATA: 1 foo 0 1 bar 0 0 1
30+ bl bar
31+ ret
You can’t perform that action at this time.
0 commit comments