Home | History | Annotate | Download | only in Index
      1 #define OBSCURE(X) X
      2 #define DECORATION
      3 
      4 typedef int T;
      5 void OBSCURE(func)(int x) {
      6   OBSCURE(T) DECORATION value;
      7 }
      8 
      9 #include "a.h"
     10 
     11 #define A(X) X
     12 #define B(X) A(X)
     13 
     14 B(int x);
     15 
     16 const char *fname = __FILE__;
     17 
     18 // RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
     19 // CHECK-1: macro definition=OBSCURE
     20 // RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
     21 // CHECK-2: macro definition=DECORATION
     22 // RUN: c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
     23 // CHECK-3: macro expansion=OBSCURE:1:9
     24 // RUN: c-index-test -cursor-at=%s:6:6 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-4 %s
     25 // CHECK-4: macro expansion=OBSCURE:1:9
     26 // RUN: c-index-test -cursor-at=%s:6:19 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-5 %s
     27 // CHECK-5: macro expansion=DECORATION:2:9
     28 // RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
     29 // CHECK-6: inclusion directive=a.h
     30 // RUN: c-index-test -cursor-at=%s:14:1 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-7 %s
     31 // CHECK-7: macro expansion=B:12:9
     32 // RUN: c-index-test -cursor-at=%s:16:25 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-8 %s
     33 // CHECK-8: macro expansion=__FILE__
     34 
     35 // Same tests, but with "editing" optimizations
     36 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
     37 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
     38 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
     39 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
     40