[RISCV][FMV] Support target_clones (#85786)
[llvm-project.git] / clang / test / CoverageMapping / md.cpp
blob41f70b889513fc17595c8aa5839b2615c4921452
1 // RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++11 %s | FileCheck %s
3 #define BREAK break
5 enum class MD {
6 Val1,
7 Val2
8 };
10 void nop() {}
12 // CHECK: foo
13 // CHECK-NEXT: File 0, [[@LINE+1]]:16 -> {{[0-9]+}}:2 = #0
14 void foo(MD i) {
15 switch (i) {
16 #define HANDLE_MD(X) \
17 case MD::X: \
18 break;
19 #include "Inputs/md.def"
20 default:
21 BREAK;
24 if (false)
25 nop();
26 #define HANDLE_MD(X) else if (i == MD::X) { nop(); }
27 #include "Inputs/md.def"
30 // CHECK: bar
31 // CHECK-NEXT: File 0, [[@LINE+3]]:12 -> [[@LINE+8]]:2 = #0
32 bool isVal1();
33 bool isVal2();
34 bool bar() {
35 #define HANDLE_MD(X) is##X() ||
36 return
37 #include "Inputs/md.def"
41 int main(int argc, const char *argv[]) {
42 foo(MD::Val1);
43 return 0;