brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.3 KiB · 9d9d3a1 Raw
130 lines · plain
1// Test is line- and column-sensitive. Run lines are below2 3/// Foo docs4struct Foo {5    /// Bar docs6    int bar;7};8 9/// Base docs10@interface Base11/// Base property docs12@property struct Foo baseProperty;13 14/// Base method docs15- (void)baseMethodWithArg:(int)arg;16@end17 18/// Protocol docs19@protocol Protocol20/// Protocol property docs21@property struct Foo protocolProperty;22@end23 24/// Derived docs25@interface Derived: Base26/// Derived method docs27- (void)derivedMethodWithValue:(id<Protocol>)value;28@end29 30@implementation Derived31- (void)derivedMethodWithValue:(id<Protocol>)value {32    int a = 5;33}34/// Impl only docs35- (void)implOnlyMethod { }36@end37 38// RUN: c-index-test -single-symbol-sgf-at=%s:4:9 local %s | FileCheck -check-prefix=CHECK-FOO %s39// 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"45 46// RUN: c-index-test -single-symbol-sgf-at=%s:6:9 local %s | FileCheck -check-prefix=CHECK-BAR %s47// 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"53 54// RUN: c-index-test -single-symbol-sgf-at=%s:10:11 local %s | FileCheck -check-prefix=CHECK-BASE %s55// 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"61 62// RUN: c-index-test -single-symbol-sgf-at=%s:12:25 local %s | FileCheck -check-prefix=CHECK-BASE-PROP %s63// 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":false66// 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"71 72// RUN: c-index-test -single-symbol-sgf-at=%s:15:9 local %s | FileCheck -check-prefix=CHECK-BASE-METHOD %s73// 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:"79 80// RUN: c-index-test -single-symbol-sgf-at=%s:19:11 local %s | FileCheck -check-prefix=CHECK-PROTOCOL %s81// 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"87 88// RUN: c-index-test -single-symbol-sgf-at=%s:21:27 local %s | FileCheck -check-prefix=CHECK-PROTOCOL-PROP %s89// 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":false92// 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"97 98// RUN: c-index-test -single-symbol-sgf-at=%s:25:15 local %s | FileCheck -check-prefix=CHECK-DERIVED %s99// 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":false102// 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"107 108// RUN: c-index-test -single-symbol-sgf-at=%s:27:11 local %s | FileCheck -check-prefix=CHECK-DERIVED-METHOD %s109// 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:"115 116// RUN: c-index-test -single-symbol-sgf-at=%s:31:11 local %s | FileCheck -check-prefix=CHECK-DERIVED-METHOD-IMPL %s117// 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:"123 124// RUN: c-index-test -single-symbol-sgf-at=%s:35:11 local %s | FileCheck -check-prefix=CHECK-IMPL-ONLY %s125// 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"130