annotate clang/test/Index/file-refs.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 namespace NS {
anatofuz
parents:
diff changeset
2 class C {
anatofuz
parents:
diff changeset
3 public:
anatofuz
parents:
diff changeset
4 C() { }
anatofuz
parents:
diff changeset
5 void m();
anatofuz
parents:
diff changeset
6 };
anatofuz
parents:
diff changeset
7 }
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 void NS::C::m() {
anatofuz
parents:
diff changeset
10 C c;
anatofuz
parents:
diff changeset
11 c.m();
anatofuz
parents:
diff changeset
12 }
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 void f() {
anatofuz
parents:
diff changeset
15 NS::C c1();
anatofuz
parents:
diff changeset
16 NS::C c2 = NS::C();
anatofuz
parents:
diff changeset
17 }
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 void over(int);
anatofuz
parents:
diff changeset
20 void over(float);
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 void test_over() {
anatofuz
parents:
diff changeset
23 over(0);
anatofuz
parents:
diff changeset
24 over(0.0f);
anatofuz
parents:
diff changeset
25 }
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 template <typename T>
anatofuz
parents:
diff changeset
28 T tf(T t) {
anatofuz
parents:
diff changeset
29 return t;
anatofuz
parents:
diff changeset
30 }
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 namespace Test2 {
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 struct S {
anatofuz
parents:
diff changeset
35 S(int x, int y);
anatofuz
parents:
diff changeset
36 S();
anatofuz
parents:
diff changeset
37 };
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 typedef S Cake;
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 void f() {
anatofuz
parents:
diff changeset
42 Cake p;
anatofuz
parents:
diff changeset
43 p = Test2::S(0,2);
anatofuz
parents:
diff changeset
44 p = Test2::Cake(0,2);
anatofuz
parents:
diff changeset
45 }
anatofuz
parents:
diff changeset
46
anatofuz
parents:
diff changeset
47 }
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 // RUN: c-index-test \
anatofuz
parents:
diff changeset
50
anatofuz
parents:
diff changeset
51 // RUN: -file-refs-at=%s:9:7 \
anatofuz
parents:
diff changeset
52 // CHECK: NamespaceRef=NS:1:11
anatofuz
parents:
diff changeset
53 // CHECK-NEXT: Namespace=NS:1:11 (Definition) =[1:11 - 1:13]
anatofuz
parents:
diff changeset
54 // CHECK-NEXT: NamespaceRef=NS:1:11 =[9:6 - 9:8]
anatofuz
parents:
diff changeset
55 // CHECK-NEXT: NamespaceRef=NS:1:11 =[15:3 - 15:5]
anatofuz
parents:
diff changeset
56 // CHECK-NEXT: NamespaceRef=NS:1:11 =[16:3 - 16:5]
anatofuz
parents:
diff changeset
57 // CHECK-NEXT: NamespaceRef=NS:1:11 =[16:14 - 16:16]
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59 // RUN: -file-refs-at=%s:2:9 \
anatofuz
parents:
diff changeset
60 // CHECK-NEXT: ClassDecl=C:2:9 (Definition)
anatofuz
parents:
diff changeset
61 // CHECK-NEXT: ClassDecl=C:2:9 (Definition) =[2:9 - 2:10]
anatofuz
parents:
diff changeset
62 // CHECK-NEXT: CXXConstructor=C:4:5 (Definition) (default constructor) =[4:5 - 4:6]
anatofuz
parents:
diff changeset
63 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[9:10 - 9:11]
anatofuz
parents:
diff changeset
64 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[10:3 - 10:4]
anatofuz
parents:
diff changeset
65 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[15:7 - 15:8]
anatofuz
parents:
diff changeset
66 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[16:7 - 16:8]
anatofuz
parents:
diff changeset
67 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[16:18 - 16:19]
anatofuz
parents:
diff changeset
68
anatofuz
parents:
diff changeset
69 // RUN: -file-refs-at=%s:16:18 \
anatofuz
parents:
diff changeset
70 // CHECK-NEXT: CallExpr=C:4:5
anatofuz
parents:
diff changeset
71 // CHECK-NEXT: ClassDecl=C:2:9 (Definition) =[2:9 - 2:10]
anatofuz
parents:
diff changeset
72 // CHECK-NEXT: CXXConstructor=C:4:5 (Definition) (default constructor) =[4:5 - 4:6]
anatofuz
parents:
diff changeset
73 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[9:10 - 9:11]
anatofuz
parents:
diff changeset
74 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[10:3 - 10:4]
anatofuz
parents:
diff changeset
75 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[15:7 - 15:8]
anatofuz
parents:
diff changeset
76 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[16:7 - 16:8]
anatofuz
parents:
diff changeset
77 // CHECK-NEXT: TypeRef=class NS::C:2:9 =[16:18 - 16:19]
anatofuz
parents:
diff changeset
78
anatofuz
parents:
diff changeset
79 // RUN: -file-refs-at=%s:20:8 \
anatofuz
parents:
diff changeset
80 // CHECK-NEXT: FunctionDecl=over:20:6
anatofuz
parents:
diff changeset
81 // CHECK-NEXT: FunctionDecl=over:20:6 =[20:6 - 20:10]
anatofuz
parents:
diff changeset
82 // CHECK-NEXT: DeclRefExpr=over:20:6 =[24:3 - 24:7]
anatofuz
parents:
diff changeset
83
anatofuz
parents:
diff changeset
84 // RUN: -file-refs-at=%s:28:1 \
anatofuz
parents:
diff changeset
85 // CHECK-NEXT: TypeRef=T:27:20
anatofuz
parents:
diff changeset
86 // FIXME: Missing TemplateTypeParameter=T:27:20 (Definition)
anatofuz
parents:
diff changeset
87 // CHECK-NEXT: TypeRef=T:27:20 =[28:1 - 28:2]
anatofuz
parents:
diff changeset
88 // CHECK-NEXT: TypeRef=T:27:20 =[28:6 - 28:7]
anatofuz
parents:
diff changeset
89
anatofuz
parents:
diff changeset
90 // RUN: -file-refs-at=%s:43:14 \
anatofuz
parents:
diff changeset
91 // CHECK-NEXT: CallExpr=S:35:3
anatofuz
parents:
diff changeset
92 // CHECK-NEXT: StructDecl=S:34:8 (Definition) =[34:8 - 34:9]
anatofuz
parents:
diff changeset
93 // CHECK-NEXT: CXXConstructor=S:35:3 =[35:3 - 35:4]
anatofuz
parents:
diff changeset
94 // CHECK-NEXT: CXXConstructor=S:36:3 (default constructor) =[36:3 - 36:4]
anatofuz
parents:
diff changeset
95 // CHECK-NEXT: TypeRef=struct Test2::S:34:8 =[39:9 - 39:10]
anatofuz
parents:
diff changeset
96 // CHECK-NEXT: TypeRef=struct Test2::S:34:8 =[43:14 - 43:15]
anatofuz
parents:
diff changeset
97
anatofuz
parents:
diff changeset
98 // RUN: -file-refs-at=%s:44:16 \
anatofuz
parents:
diff changeset
99 // CHECK-NEXT: CallExpr=S:35:3
anatofuz
parents:
diff changeset
100 // CHECK-NEXT: TypedefDecl=Cake:39:11 (Definition) =[39:11 - 39:15]
anatofuz
parents:
diff changeset
101 // CHECK-NEXT: TypeRef=Test2::Cake:39:11 =[42:3 - 42:7]
anatofuz
parents:
diff changeset
102 // CHECK-NEXT: TypeRef=Test2::Cake:39:11 =[44:14 - 44:18]
anatofuz
parents:
diff changeset
103
anatofuz
parents:
diff changeset
104 // RUN: %s | FileCheck %s