diff options
Diffstat (limited to 'llvm/test')
7 files changed, 84 insertions, 9 deletions
diff --git a/llvm/test/tools/llvm-profdata/Inputs/profile-symbol-list-ext.expected b/llvm/test/tools/llvm-profdata/Inputs/profile-symbol-list-ext.expected new file mode 100644 index 000000000000..a7912eadbc88 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/Inputs/profile-symbol-list-ext.expected @@ -0,0 +1,43 @@ +Function: main: 368038, 0, 7 sampled lines +Samples collected in the function's body { + 4: 1068 + 4.2: 1068 + 5: 2150 + 5.1: 2150 + 6: 4160 + 7: 1068 + 9: 4128, calls: _Z3bari:2942 _Z3fooi:1262, types: vtable_bar:2942 vtable_foo:1260 +} +Samples collected in inlined callsites { + 10: inlined callee: inline1: 2000, 0, 1 sampled lines + Samples collected in the function's body { + 1: 2000 + } + No inlined callsites in this function + 10: inlined callee: inline2: 4000, 0, 1 sampled lines + Samples collected in the function's body { + 1: 4000 + } + No inlined callsites in this function + 10: vtables: inline1_vtable:2000 inline2_vtable:4000 +} +Function: _Z3bari: 40602, 2874, 1 sampled lines +Samples collected in the function's body { + 1: 2874 +} +No inlined callsites in this function +Function: _Z3fooi: 15422, 1220, 1 sampled lines +Samples collected in the function's body { + 1: 1220 +} +No inlined callsites in this function +======== Dump profile symbol list ======== +_Z3goov +_Z3sumii +__libc_csu_fini +__libc_csu_init +_dl_relocate_static_pie +_fini +_init +_start +main diff --git a/llvm/test/tools/llvm-profdata/Inputs/profile-symbol-list.expected b/llvm/test/tools/llvm-profdata/Inputs/profile-symbol-list.expected index a7912eadbc88..bd528b44b81c 100644 --- a/llvm/test/tools/llvm-profdata/Inputs/profile-symbol-list.expected +++ b/llvm/test/tools/llvm-profdata/Inputs/profile-symbol-list.expected @@ -6,7 +6,7 @@ Samples collected in the function's body { 5.1: 2150 6: 4160 7: 1068 - 9: 4128, calls: _Z3bari:2942 _Z3fooi:1262, types: vtable_bar:2942 vtable_foo:1260 + 9: 4128, calls: _Z3bari:2942 _Z3fooi:1262 } Samples collected in inlined callsites { 10: inlined callee: inline1: 2000, 0, 1 sampled lines @@ -19,7 +19,6 @@ Samples collected in inlined callsites { 1: 4000 } No inlined callsites in this function - 10: vtables: inline1_vtable:2000 inline2_vtable:4000 } Function: _Z3bari: 40602, 2874, 1 sampled lines Samples collected in the function's body { diff --git a/llvm/test/tools/llvm-profdata/Inputs/sample-profile-ext.proftext b/llvm/test/tools/llvm-profdata/Inputs/sample-profile-ext.proftext new file mode 100644 index 000000000000..0a12512161a8 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/Inputs/sample-profile-ext.proftext @@ -0,0 +1,18 @@ +main:184019:0 + 4: 534 + 4.2: 534 + 5: 1075 + 5.1: 1075 + 6: 2080 + 7: 534 + 9: 2064 _Z3bari:1471 _Z3fooi:631 + 9: vtable_bar:1471 vtable_foo:630 // CallTargetVtables + 10: inline1:1000 + 1: 1000 + 10: inline2:2000 + 1: 2000 + 10: inline1_vtable:1000 inline2_vtable:2000 // CallSiteVtables +_Z3bari:20301:1437 + 1: 1437 +_Z3fooi:7711:610 + 1: 610 diff --git a/llvm/test/tools/llvm-profdata/Inputs/sample-profile.proftext b/llvm/test/tools/llvm-profdata/Inputs/sample-profile.proftext index 0a12512161a8..f9f87dfd661f 100644 --- a/llvm/test/tools/llvm-profdata/Inputs/sample-profile.proftext +++ b/llvm/test/tools/llvm-profdata/Inputs/sample-profile.proftext @@ -6,12 +6,10 @@ main:184019:0 6: 2080 7: 534 9: 2064 _Z3bari:1471 _Z3fooi:631 - 9: vtable_bar:1471 vtable_foo:630 // CallTargetVtables 10: inline1:1000 1: 1000 10: inline2:2000 1: 2000 - 10: inline1_vtable:1000 inline2_vtable:2000 // CallSiteVtables _Z3bari:20301:1437 1: 1437 _Z3fooi:7711:610 diff --git a/llvm/test/tools/llvm-profdata/profile-symbol-list-compress.test b/llvm/test/tools/llvm-profdata/profile-symbol-list-compress.test index b445695c8e8e..9a95a6246191 100644 --- a/llvm/test/tools/llvm-profdata/profile-symbol-list-compress.test +++ b/llvm/test/tools/llvm-profdata/profile-symbol-list-compress.test @@ -4,3 +4,9 @@ REQUIRES: zlib ; RUN: llvm-profdata merge -sample -extbinary -compress-all-sections %t.1.output %t.2.output -o %t.3.output ; RUN: llvm-profdata show -sample -show-prof-sym-list %t.3.output > %t.4.output ; RUN: diff -b %S/Inputs/profile-symbol-list.expected %t.4.output + +; RUN: llvm-profdata merge -sample -extbinary -compress-all-sections -prof-sym-list=%S/Inputs/profile-symbol-list-1.text %S/Inputs/sample-profile-ext.proftext -o %t.1.output +; RUN: llvm-profdata merge -sample -extbinary -compress-all-sections -prof-sym-list=%S/Inputs/profile-symbol-list-2.text %S/Inputs/sample-profile-ext.proftext -o %t.2.output +; RUN: llvm-profdata merge -sample -extbinary -compress-all-sections %t.1.output %t.2.output -o %t.3.output +; RUN: llvm-profdata show -sample -show-prof-sym-list %t.3.output > %t.4.output +; RUN: diff -b %S/Inputs/profile-symbol-list-ext.expected %t.4.output diff --git a/llvm/test/tools/llvm-profdata/profile-symbol-list.test b/llvm/test/tools/llvm-profdata/profile-symbol-list.test index 39dcd11ec1db..8c5f9d620ee7 100644 --- a/llvm/test/tools/llvm-profdata/profile-symbol-list.test +++ b/llvm/test/tools/llvm-profdata/profile-symbol-list.test @@ -7,3 +7,9 @@ ; RUN: llvm-profdata show -sample -show-sec-info-only %t.5.output | FileCheck %s -check-prefix=NOSYMLIST ; NOSYMLIST: ProfileSymbolListSection {{.*}} Size: 0 + +; RUN: llvm-profdata merge -sample -extbinary -prof-sym-list=%S/Inputs/profile-symbol-list-1.text %S/Inputs/sample-profile-ext.proftext -o %t.1.output +; RUN: llvm-profdata merge -sample -extbinary -prof-sym-list=%S/Inputs/profile-symbol-list-2.text %S/Inputs/sample-profile-ext.proftext -o %t.2.output +; RUN: llvm-profdata merge -sample -extbinary %t.1.output %t.2.output -o %t.3.output +; RUN: llvm-profdata show -sample -show-prof-sym-list %t.3.output > %t.4.output +; RUN: diff -b %S/Inputs/profile-symbol-list-ext.expected %t.4.output diff --git a/llvm/test/tools/llvm-profdata/roundtrip.test b/llvm/test/tools/llvm-profdata/roundtrip.test index 3746ac191e87..0cf518397079 100644 --- a/llvm/test/tools/llvm-profdata/roundtrip.test +++ b/llvm/test/tools/llvm-profdata/roundtrip.test @@ -6,13 +6,18 @@ RUN: llvm-profdata show -o %t.1.proftext -all-functions -text %t.1.profdata RUN: diff -b %t.1.proftext %S/Inputs/IR_profile.proftext RUN: llvm-profdata merge --sample --binary -output=%t.2.profdata %S/Inputs/sample-profile.proftext RUN: llvm-profdata merge --sample --text -output=%t.2.proftext %t.2.profdata -COM: diff -b %t.2.proftext %S/Inputs/sample-profile.proftext +RUN: diff -b %t.2.proftext %S/Inputs/sample-profile.proftext # Round trip from text --> extbinary --> text RUN: llvm-profdata merge --sample --extbinary -output=%t.3.profdata %S/Inputs/sample-profile.proftext RUN: llvm-profdata merge --sample --text -output=%t.3.proftext %t.3.profdata RUN: diff -b %t.3.proftext %S/Inputs/sample-profile.proftext # Round trip from text --> binary --> extbinary --> text -COM: llvm-profdata merge --sample --binary -output=%t.4.profdata %S/Inputs/sample-profile.proftext -COM: llvm-profdata merge --sample --extbinary -output=%t.5.profdata %t.4.profdata -COM: llvm-profdata merge --sample --text -output=%t.4.proftext %t.5.profdata -COM: diff -b %t.4.proftext %S/Inputs/sample-profile.proftext +RUN: llvm-profdata merge --sample --binary -output=%t.4.profdata %S/Inputs/sample-profile.proftext +RUN: llvm-profdata merge --sample --extbinary -output=%t.5.profdata %t.4.profdata +RUN: llvm-profdata merge --sample --text -output=%t.4.proftext %t.5.profdata +RUN: diff -b %t.4.proftext %S/Inputs/sample-profile.proftext +# Round trip from text --> extbinary --> text. +# The text profile is supported by ext-binary profile but not binary profile format. +RUN: llvm-profdata merge --sample --extbinary --output=%t.5.profdata %S/Inputs/sample-profile-ext.proftext +RUN: llvm-profdata merge --sample --text --output=%t.5.proftext %t.5.profdata +RUN: diff -b %t.5.proftext %S/Inputs/sample-profile-ext.proftext |
