Home | History | Annotate | Download | only in skip-parsed-bodies
      1 [
      2 {
      3   "directory": ".",
      4   "command": "/usr/bin/clang++ -fsyntax-only t1.cpp",
      5   "file": "t1.cpp"
      6 },
      7 {
      8   "directory": ".",
      9   "command": "/usr/bin/clang++ -fsyntax-only t2.cpp -DBLAH",
     10   "file": "t2.cpp"
     11 },
     12 {
     13   "directory": ".",
     14   "command": "/usr/bin/clang++ -fsyntax-only t3.cpp -DBLAH",
     15   "file": "t2.cpp"
     16 }
     17 ]
     18 
     19 // XFAIL: mingw32,win32,windows-gnu
     20 // RUN: c-index-test -index-compile-db %s | FileCheck %s
     21 
     22 // CHECK:      [startedTranslationUnit]
     23 // CHECK-NEXT: [enteredMainFile]: t1.cpp
     24 // CHECK:      [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
     25 // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
     26 // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:9:27
     27 // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
     28 // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: 1
     29 // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
     30 // CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C |
     31 // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:15:5
     32 // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
     33 // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:19:5
     34 // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val1'
     35 // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val2'
     36 // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val3'
     37 
     38 // CHECK-NEXT: [startedTranslationUnit]
     39 // CHECK-NEXT: [enteredMainFile]: t2.cpp
     40 // CHECK:      [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
     41 // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
     42 // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
     43 // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isContainer: skipped
     44 // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
     45 // CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C |
     46 // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
     47 // CHECK-NEXT: [ppIncludedFile]: ./pragma_once.h
     48 // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
     49 // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:25:5
     50 // CHECK:      [indexDeclaration]: kind: c++-instance-method | name: tsmeth | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
     51 // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./pragma_once.h:8:7
     52 // CHECK:      [indexDeclaration]: kind: function | name: imp_foo | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
     53 // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./imported.h:4:5
     54 // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val4'
     55 // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_tsval'
     56 // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_impval'
     57 
     58 // CHECK-NEXT: [startedTranslationUnit]
     59 // CHECK-NEXT: [enteredMainFile]: t3.cpp
     60 // CHECK:      [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
     61 // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
     62 // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
     63 // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: skipped
     64 // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
     65 // CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C |
     66 // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
     67 // CHECK-NEXT: [ppIncludedFile]: ./pragma_once.h
     68 // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
     69 // CHECK-NEXT: [indexDeclaration]: kind: variable | {{.*}} | loc: ./pragma_once.h:3:12
     70 // CHECK:      [indexDeclaration]: kind: c++-instance-method | name: tsmeth | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
     71 // CHECK-NOT:  [indexEntityReference]: kind: variable | name: some_val |
     72 // CHECK:      [indexDeclaration]: kind: function | name: imp_foo | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
     73 // CHECK-NOT:  [indexEntityReference]: kind: variable | name: some_val |
     74 // CHECK-NOT:  [diagnostic]: {{.*}} undeclared identifier
     75