[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CoverageMapping / preprocessor.c
blobdff2da6ad1d6b7a2ddebc154a8962bf398721731
1 // RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name preprocessor.c %s | FileCheck %s
3 // CHECK: func
4 void func(void) {// CHECK: File 0, [[@LINE]]:17 -> [[@LINE+5]]:2 = #0
5 int i = 0;
6 #ifdef MACRO // CHECK-NEXT: Skipped,File 0, [[@LINE]]:1 -> [[@LINE+2]]:7 = 0
7 int x = i;
8 #endif
11 // CHECK: main
12 int main(void) { // CHECK-NEXT: File 0, [[@LINE]]:16 -> {{[0-9]+}}:2 = #0
13 int i = 0;
14 #if 0 // CHECK-NEXT: Skipped,File 0, [[@LINE]]:1 -> [[@LINE+4]]:29 = 0
15 if(i == 0) {
16 i = 1;
18 # endif // Mark me skipped!
20 #if 1
21 // CHECK-NEXT: File 0, [[@LINE+1]]:6 -> [[@LINE+1]]:12 = #0
22 if(i == 0) { // CHECK: File 0, [[@LINE]]:14 -> [[@LINE+2]]:4 = #1
23 i = 1;
25 #else // CHECK-NEXT: Skipped,File 0, [[@LINE]]:1 -> [[@LINE+5]]:7 = 0
26 if(i == 1) {
27 i = 0;
30 #endif
32 // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+4]]:24
34 if 0
36 endif // also skipped
38 #if 1
39 // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+3]]:7
41 elif 0
42 #endif
44 #if 1
45 // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+3]]:7
47 else
48 #endif
50 // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+4]]:8
52 ifdef NOT_DEFINED
54 endif
56 // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+4]]:8
58 ifndef __FILE__
60 endif
62 // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+6]]:26
64 ifdef NOT_DEFINED
68 endif // also skipped
70 return 0;