summaryrefslogtreecommitdiffstats
path: root/clang/test/CoverageMapping/Inputs
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2014-08-19 17:32:30 +0000
committerAlex Lorenz <arphaman@gmail.com>2014-08-19 17:32:30 +0000
commit34ac9b5e25d3a00197ad30238d4e213f7811ebfe (patch)
tree5c632b3b63a03fa4148853693eaa68bbedc608b8 /clang/test/CoverageMapping/Inputs
parentdd6394d83344a3f61ddcf9fa0804308146d6b888 (diff)
downloadbcm5719-llvm-34ac9b5e25d3a00197ad30238d4e213f7811ebfe.tar.gz
bcm5719-llvm-34ac9b5e25d3a00197ad30238d4e213f7811ebfe.zip
Add tests for coverage mapping generation.
This patch adds the tests for the coverage mapping generation. Most of the tests check the mapping regions produced by the generator, and one checks the llvm IR. Differential Revision: http://reviews.llvm.org/D4847 llvm-svn: 215995
Diffstat (limited to 'clang/test/CoverageMapping/Inputs')
-rw-r--r--clang/test/CoverageMapping/Inputs/code.h11
-rw-r--r--clang/test/CoverageMapping/Inputs/header1.h31
2 files changed, 42 insertions, 0 deletions
diff --git a/clang/test/CoverageMapping/Inputs/code.h b/clang/test/CoverageMapping/Inputs/code.h
new file mode 100644
index 00000000000..cd3cfb5d3fe
--- /dev/null
+++ b/clang/test/CoverageMapping/Inputs/code.h
@@ -0,0 +1,11 @@
+x = x;
+if (x == 0) {
+ x = 1;
+} else {
+ x = 2;
+}
+if (true) {
+ x = x;
+} else {
+ x = x;
+}
diff --git a/clang/test/CoverageMapping/Inputs/header1.h b/clang/test/CoverageMapping/Inputs/header1.h
new file mode 100644
index 00000000000..d01e813b40b
--- /dev/null
+++ b/clang/test/CoverageMapping/Inputs/header1.h
@@ -0,0 +1,31 @@
+#ifndef HEADER1_H
+#define HEADER1_H
+
+inline void func(int i) {
+ int x = 0;
+ if (i == 0) {
+ x = 1;
+ } else {
+ x = 2;
+ }
+}
+static void static_func(int j) {
+ int x = 0;
+ if (j == x) {
+ x = !j;
+ } else {
+ x = 42;
+ }
+ j = x * j;
+}
+static void static_func2(int j) {
+ int x = 0;
+ if (j == x) {
+ x = !j;
+ } else {
+ x = 42;
+ }
+ j = x * j;
+}
+
+#endif // HEADER1_H
OpenPOWER on IntegriCloud