[libc] Switch to using the generic `<gpuintrin.h>` implementations (#121810)
[llvm-project.git] / clang / test / Index / extract-api-cursor.m
blob9d9d3a1e40f1452077e608e5fa34ceaf745cfa27
1 // Test is line- and column-sensitive. Run lines are below
3 /// Foo docs
4 struct Foo {
5     /// Bar docs
6     int bar;
7 };
9 /// Base docs
10 @interface Base
11 /// Base property docs
12 @property struct Foo baseProperty;
14 /// Base method docs
15 - (void)baseMethodWithArg:(int)arg;
16 @end
18 /// Protocol docs
19 @protocol Protocol
20 /// Protocol property docs
21 @property struct Foo protocolProperty;
22 @end
24 /// Derived docs
25 @interface Derived: Base
26 /// Derived method docs
27 - (void)derivedMethodWithValue:(id<Protocol>)value;
28 @end
30 @implementation Derived
31 - (void)derivedMethodWithValue:(id<Protocol>)value {
32     int a = 5;
34 /// Impl only docs
35 - (void)implOnlyMethod { }
36 @end
38 // RUN: c-index-test -single-symbol-sgf-at=%s:4:9 local %s | FileCheck -check-prefix=CHECK-FOO %s
39 // CHECK-FOO: "parentContexts":[{"kind":"objective-c.struct","name":"Foo","usr":"c:@S@Foo"}]
40 // CHECK-FOO: "relatedSymbols":[]
41 // CHECK-FOO: "relationships":[]
42 // CHECK-FOO: "text":"Foo docs"
43 // CHECK-FOO: "kind":{"displayName":"Structure","identifier":"objective-c.struct"}
44 // CHECK-FOO: "title":"Foo"
46 // RUN: c-index-test -single-symbol-sgf-at=%s:6:9 local %s | FileCheck -check-prefix=CHECK-BAR %s
47 // CHECK-BAR: "parentContexts":[{"kind":"objective-c.struct","name":"Foo","usr":"c:@S@Foo"},{"kind":"objective-c.property","name":"bar","usr":"c:@S@Foo@FI@bar"}]
48 // CHECK-BAR: "relatedSymbols":[]
49 // CHECK-BAR: "relationships":[{"kind":"memberOf","source":"c:@S@Foo@FI@bar","target":"c:@S@Foo"
50 // CHECK-BAR: "text":"Bar docs"
51 // CHECK-BAR: "kind":{"displayName":"Instance Property","identifier":"objective-c.property"}
52 // CHECK-BAR: "title":"bar"
54 // RUN: c-index-test -single-symbol-sgf-at=%s:10:11 local %s | FileCheck -check-prefix=CHECK-BASE %s
55 // CHECK-BASE: "parentContexts":[{"kind":"objective-c.class","name":"Base","usr":"c:objc(cs)Base"}]
56 // CHECK-BASE: "relatedSymbols":[]
57 // CHECK-BASE: "relationships":[]
58 // CHECK-BASE: "text":"Base docs"
59 // CHECK-BASE: "kind":{"displayName":"Class","identifier":"objective-c.class"}
60 // CHECK-BASE: "title":"Base"
62 // RUN: c-index-test -single-symbol-sgf-at=%s:12:25 local %s | FileCheck -check-prefix=CHECK-BASE-PROP %s
63 // CHECK-BASE-PROP: "parentContexts":[{"kind":"objective-c.class","name":"Base","usr":"c:objc(cs)Base"},{"kind":"objective-c.property","name":"baseProperty","usr":"c:objc(cs)Base(py)baseProperty"}]
64 // CHECK-BASE-PROP: "relatedSymbols":[{"accessLevel":"public","declarationLanguage":"objective-c"
65 // CHECK-BASE-PROP: "isSystem":false
66 // CHECK-BASE-PROP: "usr":"c:@S@Foo"}]
67 // CHECK-BASE-PROP: "relationships":[{"kind":"memberOf","source":"c:objc(cs)Base(py)baseProperty","target":"c:objc(cs)Base"
68 // CHECK-BASE-PROP: "text":"Base property docs"
69 // CHECK-BASE-PROP: "kind":{"displayName":"Instance Property","identifier":"objective-c.property"}
70 // CHECK-BASE-PROP: "title":"baseProperty"
72 // RUN: c-index-test -single-symbol-sgf-at=%s:15:9 local %s | FileCheck -check-prefix=CHECK-BASE-METHOD %s
73 // CHECK-BASE-METHOD: "parentContexts":[{"kind":"objective-c.class","name":"Base","usr":"c:objc(cs)Base"},{"kind":"objective-c.method","name":"baseMethodWithArg:","usr":"c:objc(cs)Base(im)baseMethodWithArg:"}]
74 // CHECK-BASE-METHOD: "relatedSymbols":[]
75 // CHECK-BASE-METHOD: "relationships":[{"kind":"memberOf","source":"c:objc(cs)Base(im)baseMethodWithArg:","target":"c:objc(cs)Base"
76 // CHECK-BASE-METHOD: "text":"Base method docs"
77 // CHECK-BASE-METHOD: "kind":{"displayName":"Instance Method","identifier":"objective-c.method"}
78 // CHECK-BASE-METHOD: "title":"baseMethodWithArg:"
80 // RUN: c-index-test -single-symbol-sgf-at=%s:19:11 local %s | FileCheck -check-prefix=CHECK-PROTOCOL %s
81 // CHECK-PROTOCOL: "parentContexts":[{"kind":"objective-c.protocol","name":"Protocol","usr":"c:objc(pl)Protocol"}]
82 // CHECK-PROTOCOL: "relatedSymbols":[]
83 // CHECK-PROTOCOL: "relationships":[]
84 // CHECK-PROTOCOL: "text":"Protocol docs"
85 // CHECK-PROTOCOL: "kind":{"displayName":"Protocol","identifier":"objective-c.protocol"}
86 // CHECK-PROTOCOL: "title":"Protocol"
88 // RUN: c-index-test -single-symbol-sgf-at=%s:21:27 local %s | FileCheck -check-prefix=CHECK-PROTOCOL-PROP %s
89 // CHECK-PROTOCOL-PROP: "parentContexts":[{"kind":"objective-c.protocol","name":"Protocol","usr":"c:objc(pl)Protocol"},{"kind":"objective-c.property","name":"protocolProperty","usr":"c:objc(pl)Protocol(py)protocolProperty"}]
90 // CHECK-PROTOCOL-PROP: "relatedSymbols":[{"accessLevel":"public","declarationLanguage":"objective-c"
91 // CHECK-PROTOCOL-PROP: "isSystem":false
92 // CHECK-PROTOCOL-PROP: "usr":"c:@S@Foo"}]
93 // CHECK-PROTOCOL-PROP: "relationships":[{"kind":"memberOf","source":"c:objc(pl)Protocol(py)protocolProperty","target":"c:objc(pl)Protocol"
94 // CHECK-PROTOCOL-PROP: "text":"Protocol property docs"
95 // CHECK-PROTOCOL-PROP: "kind":{"displayName":"Instance Property","identifier":"objective-c.property"}
96 // CHECK-PROTOCOL-PROP: "title":"protocolProperty"
98 // RUN: c-index-test -single-symbol-sgf-at=%s:25:15 local %s | FileCheck -check-prefix=CHECK-DERIVED %s
99 // CHECK-DERIVED: "parentContexts":[{"kind":"objective-c.class","name":"Derived","usr":"c:objc(cs)Derived"}]
100 // CHECK-DERIVED: "relatedSymbols":[{"accessLevel":"public","declarationLanguage":"objective-c"
101 // CHECK-DERIVED: "isSystem":false
102 // CHECK-DERIVED: "usr":"c:objc(cs)Base"}]
103 // CHECK-DERIVED: "relationships":[{"kind":"inheritsFrom","source":"c:objc(cs)Derived","target":"c:objc(cs)Base"
104 // CHECK-DERIVED: "text":"Derived docs"
105 // CHECK-DERIVED: "kind":{"displayName":"Class","identifier":"objective-c.class"}
106 // CHECK-DERIVED: "title":"Derived"
108 // RUN: c-index-test -single-symbol-sgf-at=%s:27:11 local %s | FileCheck -check-prefix=CHECK-DERIVED-METHOD %s
109 // CHECK-DERIVED-METHOD: "parentContexts":[{"kind":"objective-c.class","name":"Derived","usr":"c:objc(cs)Derived"},{"kind":"objective-c.method","name":"derivedMethodWithValue:","usr":"c:objc(cs)Derived(im)derivedMethodWithValue:"}]
110 // CHECK-DERIVED-METHOD: "relatedSymbols":[]
111 // CHECK-DERIVED-METHOD: "relationships":[{"kind":"memberOf","source":"c:objc(cs)Derived(im)derivedMethodWithValue:","target":"c:objc(cs)Derived"
112 // CHECK-DERIVED-METHOD: "text":"Derived method docs"
113 // CHECK-DERIVED-METHOD: "kind":{"displayName":"Instance Method","identifier":"objective-c.method"}
114 // CHECK-DERIVED-METHOD: "title":"derivedMethodWithValue:"
116 // RUN: c-index-test -single-symbol-sgf-at=%s:31:11 local %s | FileCheck -check-prefix=CHECK-DERIVED-METHOD-IMPL %s
117 // CHECK-DERIVED-METHOD-IMPL: "parentContexts":[{"kind":"objective-c.class","name":"Derived","usr":"c:objc(cs)Derived"},{"kind":"objective-c.method","name":"derivedMethodWithValue:","usr":"c:objc(cs)Derived(im)derivedMethodWithValue:"}]
118 // CHECK-DERIVED-METHOD-IMPL: "relatedSymbols":[]
119 // CHECK-DERIVED-METHOD-IMPL: "relationships":[{"kind":"memberOf","source":"c:objc(cs)Derived(im)derivedMethodWithValue:","target":"c:objc(cs)Derived"
120 // CHECK-DERIVED-METHOD-IMPL: "text":"Derived method docs"
121 // CHECK-DERIVED-METHOD-IMPL: "kind":{"displayName":"Instance Method","identifier":"objective-c.method"}
122 // CHECK-DERIVED-METHOD-IMPL: "title":"derivedMethodWithValue:"
124 // RUN: c-index-test -single-symbol-sgf-at=%s:35:11 local %s | FileCheck -check-prefix=CHECK-IMPL-ONLY %s
125 // CHECK-IMPL-ONLY: "relatedSymbols":[]
126 // CHECK-IMPL-ONLY: "relationships":[{"kind":"memberOf","source":"c:objc(cs)Derived(im)implOnlyMethod","target":"c:objc(cs)Derived"
127 // CHECK-IMPL-ONLY: "text":"Impl only docs"
128 // CHECK-IMPL-ONLY: "kind":{"displayName":"Instance Method","identifier":"objective-c.method"}
129 // CHECK-IMPL-ONLY: "title":"implOnlyMethod"