diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
commit | 2b6b257f4e5503a7a2675bdb8735693db769f75c (patch) | |
tree | e85e046ae7003fe3bcc8b5454cd0fa3f7407b470 /test/CoverageMapping/macro-expressions.cpp | |
parent | b4348ed0b7e90c0831b925fbee00b5f179a99796 (diff) |
Notes
Diffstat (limited to 'test/CoverageMapping/macro-expressions.cpp')
-rw-r--r-- | test/CoverageMapping/macro-expressions.cpp | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/test/CoverageMapping/macro-expressions.cpp b/test/CoverageMapping/macro-expressions.cpp index 1085ab02492f..3852fc6a23b7 100644 --- a/test/CoverageMapping/macro-expressions.cpp +++ b/test/CoverageMapping/macro-expressions.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macro-expressions.cpp %s | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macro-expressions.cpp %s | FileCheck %s #define EXPR(x) (x) #define NEXPR(x) (!x) @@ -12,6 +12,44 @@ #define PRIo64 PRI_64_LENGTH_MODIFIER "o" #define PRIu64 PRI_64_LENGTH_MODIFIER "u" +#define STMT(s) s + +void fn1() { + STMT(if (1)); + STMT(while (1)); + STMT(for (;;)); + STMT(if) (1); + STMT(while) (1); + STMT(for) (;;); + if (1) + STMT(if (1) + STMT(if (1))); + if (1) + STMT(if (1)) 0; + if (1) + STMT(while (1)) 0; + if (1) + STMT(for (;;)) 0; + while (1) + STMT(if (1)) 0; + while (1) + STMT(while (1)) 0; + while (1) + STMT(for (;;)) 0; + for (;;) + STMT(if (1)) 0; + for (;;) + STMT(while (1)) 0; + for (;;) + STMT(for (;;)) 0; +} + +void STMT(fn2()) { +} + +void STMT(fn3)() { +} + // CHECK: foo // CHECK-NEXT: File 0, [[@LINE+1]]:17 -> {{[0-9]+}}:2 = #0 void foo(int i) { |