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