summaryrefslogtreecommitdiff
path: root/test/tools
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-21 21:20:35 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-21 21:20:35 +0000
commitaa4135aa7fbfa2fbacae10f6e58809c20a3a7459 (patch)
tree4961a466e9cd14d3ad265c94ac5f1c8f2311d451 /test/tools
parent50f9696f1d8fac2ec4e99a12e4ba65276c8364c5 (diff)
downloadllvm-aa4135aa7fbfa2fbacae10f6e58809c20a3a7459.tar.gz
llvm-aa4135aa7fbfa2fbacae10f6e58809c20a3a7459.tar.bz2
llvm-aa4135aa7fbfa2fbacae10f6e58809c20a3a7459.tar.xz
InstrProf: Cleanup binary profdata testcase
Cleanup the current binary testcase for profile data. - Rename it to something more specific. - Remove the text comparison. - Check the output of llvm-profdata show. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204518 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tools')
-rw-r--r--test/tools/llvm-profdata/Inputs/binary-compare.profdata150
-rw-r--r--test/tools/llvm-profdata/Inputs/c-general.profdata (renamed from test/tools/llvm-profdata/Inputs/binary.profdata)bin1384 -> 1384 bytes
-rw-r--r--test/tools/llvm-profdata/binary.test15
-rw-r--r--test/tools/llvm-profdata/c-general.test24
4 files changed, 24 insertions, 165 deletions
diff --git a/test/tools/llvm-profdata/Inputs/binary-compare.profdata b/test/tools/llvm-profdata/Inputs/binary-compare.profdata
deleted file mode 100644
index a1d56104a2..0000000000
--- a/test/tools/llvm-profdata/Inputs/binary-compare.profdata
+++ /dev/null
@@ -1,150 +0,0 @@
-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/test/tools/llvm-profdata/Inputs/binary.profdata b/test/tools/llvm-profdata/Inputs/c-general.profdata
index e8cef21de5..e8cef21de5 100644
--- a/test/tools/llvm-profdata/Inputs/binary.profdata
+++ b/test/tools/llvm-profdata/Inputs/c-general.profdata
Binary files differ
diff --git a/test/tools/llvm-profdata/binary.test b/test/tools/llvm-profdata/binary.test
deleted file mode 100644
index d3a1c3fae0..0000000000
--- a/test/tools/llvm-profdata/binary.test
+++ /dev/null
@@ -1,15 +0,0 @@
-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
diff --git a/test/tools/llvm-profdata/c-general.test b/test/tools/llvm-profdata/c-general.test
new file mode 100644
index 0000000000..9b6cd7f482
--- /dev/null
+++ b/test/tools/llvm-profdata/c-general.test
@@ -0,0 +1,24 @@
+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/c-general.profdata ./a.out
+
+RUN: llvm-profdata show %p/Inputs/c-general.profdata -o - | FileCheck %s -check-prefix=CHECK
+RUN: llvm-profdata show %p/Inputs/c-general.profdata -o - --function=switches | FileCheck %s -check-prefix=SWITCHES -check-prefix=CHECK
+
+SWITCHES-LABEL: Counters:
+SWITCHES-NEXT: switches:
+SWITCHES-NEXT: Hash: 0x0000000000000013
+SWITCHES-NEXT: Counters: 19
+SWITCHES-NEXT: Function count: 1
+SWITCHES-LABEL: Functions shown: 1
+
+CHECK-LABEL: Total functions: 11
+CHECK-NEXT: Maximum function count: 1
+CHECK-NEXT: Maximum internal block count: 100