summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-profdata
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-21 18:26:05 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-21 18:26:05 +0000
commit24b4b6533925e6dbd0faef7976c7f794499e0ec6 (patch)
tree205636d9f9b574584985d0583ae6506b8a9bfcfd /llvm/test/tools/llvm-profdata
parent76e8731b09f1ca6a05001060a00b1b1a77d1dc4a (diff)
downloadbcm5719-llvm-24b4b6533925e6dbd0faef7976c7f794499e0ec6.tar.gz
bcm5719-llvm-24b4b6533925e6dbd0faef7976c7f794499e0ec6.zip
InstrProf: Read raw binary profile in llvm-profdata
Read a raw binary profile that corresponds to a memory dump from the runtime profile. The test is a binary file generated from cfe/trunk/test/Profile/c-general.c with the new compiler-rt runtime and the matching text version of the input. It includes instructions on how to regenerate. <rdar://problem/15950346> llvm-svn: 204496
Diffstat (limited to 'llvm/test/tools/llvm-profdata')
-rw-r--r--llvm/test/tools/llvm-profdata/Inputs/binary-compare.profdata150
-rw-r--r--llvm/test/tools/llvm-profdata/Inputs/binary.profdatabin0 -> 1384 bytes
-rw-r--r--llvm/test/tools/llvm-profdata/binary.test15
3 files changed, 165 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-profdata/Inputs/binary-compare.profdata b/llvm/test/tools/llvm-profdata/Inputs/binary-compare.profdata
new file mode 100644
index 00000000000..a1d56104a21
--- /dev/null
+++ b/llvm/test/tools/llvm-profdata/Inputs/binary-compare.profdata
@@ -0,0 +1,150 @@
+simple_loops
+4
+4
+1
+100
+100
+75
+
+conditionals
+11
+11
+1
+100
+50
+50
+33
+33
+16
+99
+100
+99
+100
+
+early_exits
+9
+9
+1
+0
+51
+1
+25
+1
+25
+1
+0
+
+jumps
+22
+22
+1
+1
+0
+1
+0
+0
+1
+0
+1
+2
+3
+2
+0
+3
+0
+1
+1
+1
+10
+0
+10
+9
+
+switches
+19
+19
+1
+1
+1
+15
+7
+1
+0
+2
+2
+3
+3
+4
+4
+0
+4
+4
+5
+1
+0
+
+big_switch
+17
+17
+1
+32
+32
+1
+0
+1
+1
+11
+11
+1
+1
+15
+15
+1
+1
+2
+2
+
+boolean_operators
+8
+8
+1
+100
+34
+66
+17
+34
+33
+50
+
+boolop_loops
+9
+9
+1
+50
+51
+50
+26
+50
+51
+50
+26
+
+do_fallthrough
+4
+4
+1
+10
+2
+8
+
+main
+1
+1
+1
+
+c-general.c:static_func
+2
+2
+1
+10
+
diff --git a/llvm/test/tools/llvm-profdata/Inputs/binary.profdata b/llvm/test/tools/llvm-profdata/Inputs/binary.profdata
new file mode 100644
index 00000000000..156c483d15f
--- /dev/null
+++ b/llvm/test/tools/llvm-profdata/Inputs/binary.profdata
Binary files differ
diff --git a/llvm/test/tools/llvm-profdata/binary.test b/llvm/test/tools/llvm-profdata/binary.test
new file mode 100644
index 00000000000..d3a1c3fae09
--- /dev/null
+++ b/llvm/test/tools/llvm-profdata/binary.test
@@ -0,0 +1,15 @@
+REGENERATE: You need a checkout of clang with compiler-rt to generate the
+REGENERATE: binary file here. These shell commands can be used to regenerate
+REGENERATE: it.
+REGENERATE:
+REGENERATE: $ SRC=path/to/llvm
+REGENERATE: $ CFE=$SRC/tools/clang
+REGENERATE: $ TESTDIR=$SRC/test/tools/llvm-profdata
+REGENERATE: $ CFE_TESTDIR=$CFE/test/Profile
+REGENERATE: $ clang -o a.out -fprofile-instr-generate $CFE_TESTDIR/test/Profile/c-general.c
+REGENERATE: $ LLVM_PROFILE_FILE=$TESTDIR/Inputs/binary.profdata ./a.out
+REGENERATE: $ cp $CFE_TESTDIR/Inputs/c-general.profdata $TESTDIR/Inputs/binary-compare.profdata
+
+RUN: llvm-profdata show %p/Inputs/binary.profdata -o %t1
+RUN: llvm-profdata show %p/Inputs/binary-compare.profdata -o %t2
+RUN: diff -up %t1 %t2
OpenPOWER on IntegriCloud