diff options
| author | Mircea Trofin <mtrofin@google.com> | 2018-03-21 19:06:06 +0000 |
|---|---|---|
| committer | Mircea Trofin <mtrofin@google.com> | 2018-03-21 19:06:06 +0000 |
| commit | 71349ff07df41ba1c0decb99d05f85bbaa2d256a (patch) | |
| tree | c1240f806e6bbb445e4cf599bfd2905bf16d47b1 /llvm/test/tools/llvm-profdata | |
| parent | 6f22226d6c7c013d522ce5f2c192c691a09d64e1 (diff) | |
| download | bcm5719-llvm-71349ff07df41ba1c0decb99d05f85bbaa2d256a.tar.gz bcm5719-llvm-71349ff07df41ba1c0decb99d05f85bbaa2d256a.zip | |
[InstrProf] Support for external functions in text format.
Summary:
External functions appearing as indirect call targets could not be
found in the SymTab, and the value:counter record was represented,
in the text format, using an empty string for the name. This would
then cause a silent parsing error when reading.
This CL:
- adds explicit support for such functions
- fixes the places where we would not propagate errors when reading
- addresses a performance issue due to eager resorting of the SymTab.
Reviewers: xur, eraman, davidxl
Reviewed By: davidxl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D44717
llvm-svn: 328132
Diffstat (limited to 'llvm/test/tools/llvm-profdata')
| -rw-r--r-- | llvm/test/tools/llvm-profdata/invalid-profdata.test | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-profdata/invalid-profdata.test b/llvm/test/tools/llvm-profdata/invalid-profdata.test new file mode 100644 index 00000000000..b6391b03464 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/invalid-profdata.test @@ -0,0 +1,50 @@ +RUN: echo ":ir" > %t.input +RUN: echo "_ZN6Thread5StartEv" >> %t.input +RUN: echo "# Func Hash:" >> %t.input +RUN: echo "288793635542036872" >> %t.input +RUN: echo "# Num Counters:" >> %t.input +RUN: echo "3" >> %t.input +RUN: echo "# Counter Values:" >> %t.input +RUN: echo "0" >> %t.input +RUN: echo "12" >> %t.input +RUN: echo "12" >> %t.input +RUN: echo "# Num Value Kinds:" >> %t.input +RUN: echo "1" >> %t.input +RUN: echo "# ValueKind = IPVK_IndirectCallTarget:" >> %t.input +RUN: echo "0" >> %t.input +RUN: echo "# NumValueSites:" >> %t.input +RUN: echo "2" >> %t.input +RUN: echo "2" >> %t.input +RUN: echo "f1:10" >> %t.input +RUN: echo "f2:0" >> %t.input +RUN: echo "1" >> %t.input +RUN: echo ":10" >> %t.input + +RUN: not llvm-profdata merge %t.input -text -output=/dev/null 2>&1 | FileCheck %s --check-prefix=BROKEN +BROKEN: Malformed instrumentation profile data + +RUN: echo ":ir" > %t.input +RUN: echo "_ZN6Thread5StartEv" >> %t.input +RUN: echo "# Func Hash:" >> %t.input +RUN: echo "288793635542036872" >> %t.input +RUN: echo "# Num Counters:" >> %t.input +RUN: echo "3" >> %t.input +RUN: echo "# Counter Values:" >> %t.input +RUN: echo "0" >> %t.input +RUN: echo "12" >> %t.input +RUN: echo "12" >> %t.input +RUN: echo "# Num Value Kinds:" >> %t.input +RUN: echo "1" >> %t.input +RUN: echo "# ValueKind = IPVK_IndirectCallTarget:" >> %t.input +RUN: echo "0" >> %t.input +RUN: echo "# NumValueSites:" >> %t.input +RUN: echo "2" >> %t.input +RUN: echo "2" >> %t.input +RUN: echo "f1:10" >> %t.input +RUN: echo "f2:0" >> %t.input +RUN: echo "1" >> %t.input +RUN: echo "** External Symbol **:10" >> %t.input + +# RUN: llvm-profdata merge %t.input -text -output=%t.out && cat %t.out | FileCheck %s + +CHECK: ** External Symbol **:10 |

