summaryrefslogtreecommitdiffstats
path: root/clang/test/CoverageMapping
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CoverageMapping')
-rw-r--r--clang/test/CoverageMapping/if.cpp (renamed from clang/test/CoverageMapping/if.c)13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/test/CoverageMapping/if.c b/clang/test/CoverageMapping/if.cpp
index 69544f68cfe..95e6d8abe63 100644
--- a/clang/test/CoverageMapping/if.c
+++ b/clang/test/CoverageMapping/if.cpp
@@ -1,5 +1,16 @@
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name if.c %s | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++1z -triple %itanium_abi_triple -main-file-name if.cpp %s | FileCheck %s
+int nop() { return 0; }
+
+// CHECK-LABEL: _Z3foov:
+void foo() { // CHECK-NEXT: [[@LINE]]:12 -> [[@LINE+5]]:2 = #0
+ if (int j = true ? nop() // CHECK-NEXT: [[@LINE]]:22 -> [[@LINE]]:27 = #2
+ : nop(); // CHECK-NEXT: [[@LINE]]:22 -> [[@LINE]]:27 = (#0 - #2)
+ j) // CHECK-NEXT: [[@LINE]]:7 -> [[@LINE]]:8 = #0
+ ++j; // CHECK-NEXT: [[@LINE]]:5 -> [[@LINE]]:8 = #1
+}
+
+// CHECK-LABEL: main:
int main() { // CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = #0
int i = 0;
// CHECK-NEXT: File 0, [[@LINE+1]]:6 -> [[@LINE+1]]:12 = #0
OpenPOWER on IntegriCloud