diff options
author | Vedant Kumar <vsk@apple.com> | 2016-10-14 23:38:16 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-10-14 23:38:16 +0000 |
commit | 9d2a16b9b19bb3c63f7cba894fa1043b1487768d (patch) | |
tree | 77a1276e0a955cfb0ef55c6daba36525f6b161ce /clang/test/CoverageMapping | |
parent | f2a6ec55215dbbbadcc78a0e091c1cfda611cdef (diff) | |
download | bcm5719-llvm-9d2a16b9b19bb3c63f7cba894fa1043b1487768d.tar.gz bcm5719-llvm-9d2a16b9b19bb3c63f7cba894fa1043b1487768d.zip |
[Coverage] Support for C++17 if initializers
Differential Revision: https://reviews.llvm.org/D25572
llvm-svn: 284293
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 |