• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name preprocessor.c %s | FileCheck %s
2 
3                  // CHECK: func
func()4 void func() {    // CHECK: File 0, [[@LINE]]:13 -> [[@LINE+5]]:2 = #0
5   int i = 0;
6 #ifdef MACRO     // CHECK-NEXT: Skipped,File 0, [[@LINE]]:2 -> [[@LINE+2]]:2 = 0
7   int x = i;
8 #endif
9 }
10 
11 #if 0
12   int g = 0;
13 
bar()14   void bar() { }
15 #endif
16 
17                  // CHECK: main
main()18 int main() {     // CHECK-NEXT: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = #0
19   int i = 0;
20 #if 0            // CHECK-NEXT: Skipped,File 0, [[@LINE]]:2 -> [[@LINE+4]]:2 = 0
21   if(i == 0) {
22     i = 1;
23   }
24 #endif
25 
26 #if 1
27                  // CHECK-NEXT: File 0, [[@LINE+1]]:6 -> [[@LINE+1]]:12 = #0
28   if(i == 0) {   // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE+2]]:4 = #1
29     i = 1;
30   }
31 #else            // CHECK-NEXT: Skipped,File 0, [[@LINE]]:2 -> [[@LINE+5]]:2 = 0
32   if(i == 1) {
33     i = 0;
34   }
35 }
36 #endif
37   return 0;
38 }
39