summaryrefslogtreecommitdiff
path: root/test/CoverageMapping
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-10-14 23:38:16 +0000
committerVedant Kumar <vsk@apple.com>2016-10-14 23:38:16 +0000
commitf34d92b55bb16ecfa6cb5808c3ca455b90c85429 (patch)
tree8a09c05551b6a9810e9bac7fc7684a93661306e7 /test/CoverageMapping
parent21c62934c7834d061a174f6865171ecf7c230cf6 (diff)
[Coverage] Support for C++17 if initializers
Differential Revision: https://reviews.llvm.org/D25572 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284293 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CoverageMapping')
-rw-r--r--test/CoverageMapping/if.cpp (renamed from test/CoverageMapping/if.c)13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/CoverageMapping/if.c b/test/CoverageMapping/if.cpp
index 69544f68cf..95e6d8abe6 100644
--- a/test/CoverageMapping/if.c
+++ b/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