Argyrios Kyrtzidis | e422e45 | 2011-12-13 18:47:41 +0000 | [diff] [blame] | 1 | |
| 2 | namespace NS { |
| 3 | extern int gx; |
| 4 | typedef int MyInt; |
| 5 | } |
| 6 | |
| 7 | enum { |
| 8 | EnumVal = 1 |
| 9 | }; |
| 10 | |
| 11 | NS::MyInt NS::gx = EnumVal; |
| 12 | |
| 13 | void foo() { |
| 14 | NS::MyInt x; |
| 15 | } |
| 16 | |
| 17 | enum { |
| 18 | SecondVal = EnumVal |
| 19 | }; |
| 20 | |
| 21 | // RUN: c-index-test -index-file %s | FileCheck %s |
| 22 | // CHECK: [indexDeclaration]: kind: namespace | name: NS |
| 23 | // CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx |
| 24 | // CHECK-NEXT: [indexDeclaration]: kind: typedef | name: MyInt |
| 25 | // CHECK-NEXT: [indexDeclaration]: kind: enum |
| 26 | // CHECK-NEXT: [indexDeclaration]: kind: enumerator | name: EnumVal |
| 27 | // CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx |
| 28 | // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
| 29 | // CHECK-NEXT: [indexEntityReference]: kind: typedef | name: MyInt |
| 30 | // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
| 31 | // CHECK-NEXT: [indexEntityReference]: kind: enumerator | name: EnumVal |
| 32 | // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo |
| 33 | // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
| 34 | // CHECK-NEXT: [indexEntityReference]: kind: typedef | name: MyInt |
| 35 | // CHECK-NEXT: [indexDeclaration]: kind: enum |
| 36 | // CHECK-NEXT: [indexDeclaration]: kind: enumerator | name: SecondVal |
| 37 | // CHECK-NEXT: [indexEntityReference]: kind: enumerator | name: EnumVal |