aboutsummaryrefslogtreecommitdiffstats
path: root/test/tools/llvm-cov/showLineExecutionCounts.cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-12-04 19:51:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-04 19:51:48 +0000
commita21bbdfad461e957fa42ac9d6860ddc9de2da3e9 (patch)
tree8d32ff2094b47e15a8def30d62fd7dee6e009de3 /test/tools/llvm-cov/showLineExecutionCounts.cpp
parent6b8c6a5088c221af2b25065b8b6b8b0fec8a116f (diff)
parent876d6995443e99d13696f3941c3a789a4daa7c7a (diff)
downloadexternal_llvm-a21bbdfad461e957fa42ac9d6860ddc9de2da3e9.zip
external_llvm-a21bbdfad461e957fa42ac9d6860ddc9de2da3e9.tar.gz
external_llvm-a21bbdfad461e957fa42ac9d6860ddc9de2da3e9.tar.bz2
am 876d6995: Merge "Update aosp/master LLVM for rebase to r222494."
* commit '876d6995443e99d13696f3941c3a789a4daa7c7a': Update aosp/master LLVM for rebase to r222494.
Diffstat (limited to 'test/tools/llvm-cov/showLineExecutionCounts.cpp')
-rw-r--r--test/tools/llvm-cov/showLineExecutionCounts.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/tools/llvm-cov/showLineExecutionCounts.cpp b/test/tools/llvm-cov/showLineExecutionCounts.cpp
new file mode 100644
index 0000000..34baa57
--- /dev/null
+++ b/test/tools/llvm-cov/showLineExecutionCounts.cpp
@@ -0,0 +1,30 @@
+// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %S/Inputs/lineExecutionCounts.profdata -no-colors -filename-equivalence %s | FileCheck -check-prefix=CHECK -check-prefix=WHOLE-FILE %s
+// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %S/Inputs/lineExecutionCounts.profdata -no-colors -filename-equivalence -name=main %s | FileCheck -check-prefix=CHECK -check-prefix=FILTER %s
+
+// before any coverage // WHOLE-FILE: | [[@LINE]]|// before
+ // FILTER-NOT: | [[@LINE-1]]|// before
+int main() { // CHECK: 1| [[@LINE]]|int main(
+ int x = 0; // CHECK: 1| [[@LINE]]| int x
+ // CHECK: 1| [[@LINE]]|
+ if (x) { // CHECK: 0| [[@LINE]]| if (x)
+ x = 0; // CHECK: 0| [[@LINE]]| x = 0
+ } else { // CHECK: 1| [[@LINE]]| } else
+ x = 1; // CHECK: 1| [[@LINE]]| x = 1
+ } // CHECK: 1| [[@LINE]]| }
+ // CHECK: 1| [[@LINE]]|
+ for (int i = 0; i < 100; ++i) { // CHECK: 100| [[@LINE]]| for (
+ x = 1; // CHECK: 100| [[@LINE]]| x = 1
+ } // CHECK: 100| [[@LINE]]| }
+ // CHECK: 1| [[@LINE]]|
+ x = x < 10 ? x + 1 : x - 1; // CHECK: 0| [[@LINE]]| x =
+ x = x > 10 ? // CHECK: 1| [[@LINE]]| x =
+ x - 1: // CHECK: 0| [[@LINE]]| x
+ x + 1; // CHECK: 1| [[@LINE]]| x
+ // CHECK: 1| [[@LINE]]|
+ return 0; // CHECK: 1| [[@LINE]]| return
+} // CHECK: 1| [[@LINE]]|}
+// after coverage // WHOLE-FILE: | [[@LINE]]|// after
+ // FILTER-NOT: | [[@LINE-1]]|// after
+
+// llvm-cov doesn't work on big endian yet
+// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc