xref: /minix3/external/bsd/llvm/dist/clang/test/Index/complete-documentation-properties.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// Note: the run lines follow their respective tests, since line/column numbers
2*f4a2713aSLionel Sambuc// matter in this test.
3*f4a2713aSLionel Sambuc// This test is for when property accessors do not have their own code
4*f4a2713aSLionel Sambuc// completion comments. Use those in their properties in this case.
5*f4a2713aSLionel Sambuc// rdar://12791315
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc@interface AppDelegate
8*f4a2713aSLionel Sambuc/**
9*f4a2713aSLionel Sambuc  \brief This is ReadonlyProperty
10*f4a2713aSLionel Sambuc*/
11*f4a2713aSLionel Sambuc@property (readonly, getter = ReadonlyGetter) id MyProperty;
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuc/**
14*f4a2713aSLionel Sambuc  \brief This is GeneralProperty
15*f4a2713aSLionel Sambuc*/
16*f4a2713aSLionel Sambuc@property int GeneralProperty;
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc/**
19*f4a2713aSLionel Sambuc  \brief This is PropertyInPrimaryClass
20*f4a2713aSLionel Sambuc*/
21*f4a2713aSLionel Sambuc@property (copy, nonatomic) id PropertyInPrimaryClass;
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc- (void) setThisRecord : (id)arg;
24*f4a2713aSLionel Sambuc- (id) Record;
25*f4a2713aSLionel Sambuc@end
26*f4a2713aSLionel Sambuc
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambuc@interface AppDelegate()
29*f4a2713aSLionel Sambuc- (id) GetterInClassExtension;
30*f4a2713aSLionel Sambuc/**
31*f4a2713aSLionel Sambuc  \brief This is Record
32*f4a2713aSLionel Sambuc*/
33*f4a2713aSLionel Sambuc@property (copy, setter = setThisRecord:) id Record;
34*f4a2713aSLionel Sambuc@end
35*f4a2713aSLionel Sambuc
36*f4a2713aSLionel Sambuc@interface AppDelegate()
37*f4a2713aSLionel Sambuc/**
38*f4a2713aSLionel Sambuc  \brief This is PropertyInClassExtension
39*f4a2713aSLionel Sambuc*/
40*f4a2713aSLionel Sambuc@property (copy, getter = GetterInClassExtension) id PropertyInClassExtension;
41*f4a2713aSLionel Sambuc
42*f4a2713aSLionel Sambuc- (id) PropertyInPrimaryClass;
43*f4a2713aSLionel Sambuc@end
44*f4a2713aSLionel Sambuc
45*f4a2713aSLionel Sambuc@implementation AppDelegate
46*f4a2713aSLionel Sambuc- (id) PropertyInPrimaryClass {
47*f4a2713aSLionel Sambuc  id p = [self ReadonlyGetter];
48*f4a2713aSLionel Sambuc  p = [self GetterInClassExtension];
49*f4a2713aSLionel Sambuc  p = [self PropertyInPrimaryClass];
50*f4a2713aSLionel Sambuc  p = [self Record];
51*f4a2713aSLionel Sambuc  [self setThisRecord : (id)0 ];
52*f4a2713aSLionel Sambuc  p = self.GetterInClassExtension;
53*f4a2713aSLionel Sambuc  return 0;
54*f4a2713aSLionel Sambuc}
55*f4a2713aSLionel Sambuc@end
56*f4a2713aSLionel Sambuc// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:47:16 %s | FileCheck -check-prefix=CHECK-CC1 %s
57*f4a2713aSLionel Sambuc// CHECK-CC1: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is ReadonlyProperty)
58*f4a2713aSLionel Sambuc
59*f4a2713aSLionel Sambuc// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:48:13 %s | FileCheck -check-prefix=CHECK-CC2 %s
60*f4a2713aSLionel Sambuc// CHECK-CC2: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension)
61*f4a2713aSLionel Sambuc
62*f4a2713aSLionel Sambuc// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:49:13 %s | FileCheck -check-prefix=CHECK-CC3 %s
63*f4a2713aSLionel Sambuc// CHECK-CC3: {TypedText PropertyInPrimaryClass}{{.*}}(brief comment: This is PropertyInPrimaryClass)
64*f4a2713aSLionel Sambuc
65*f4a2713aSLionel Sambuc// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:50:13 %s | FileCheck -check-prefix=CHECK-CC4 %s
66*f4a2713aSLionel Sambuc// CHECK-CC4: {TypedText Record}{{.*}}(brief comment: This is Record)
67*f4a2713aSLionel Sambuc
68*f4a2713aSLionel Sambuc// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:51:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
69*f4a2713aSLionel Sambuc// CHECK-CC5: {TypedText setThisRecord:}{Placeholder (id)}{{.*}}(brief comment: This is Record)
70*f4a2713aSLionel Sambuc
71*f4a2713aSLionel Sambuc// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:52:12 %s | FileCheck -check-prefix=CHECK-CC6 %s
72*f4a2713aSLionel Sambuc// CHECK-CC6: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension)
73*f4a2713aSLionel Sambuc
74*f4a2713aSLionel Sambuc@interface AnotherAppDelegate
75*f4a2713aSLionel Sambuc/**
76*f4a2713aSLionel Sambuc  \brief This is ReadonlyProperty
77*f4a2713aSLionel Sambuc*/
78*f4a2713aSLionel Sambuc@property (getter = ReadonlyGetter) int MyProperty;
79*f4a2713aSLionel Sambuc/**
80*f4a2713aSLionel Sambuc  \brief This is getter = ReadonlyGetter
81*f4a2713aSLionel Sambuc*/
82*f4a2713aSLionel Sambuc- (int) ReadonlyGetter;
83*f4a2713aSLionel Sambuc@end
84*f4a2713aSLionel Sambuc
85*f4a2713aSLionel Sambuc@implementation AnotherAppDelegate
86*f4a2713aSLionel Sambuc- (int) PropertyInPrimaryClass {
87*f4a2713aSLionel Sambucself.ReadonlyGetter;
88*f4a2713aSLionel Sambuc}
89*f4a2713aSLionel Sambuc@end
90*f4a2713aSLionel Sambuc// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:87:6 %s | FileCheck -check-prefix=CHECK-CC7 %s
91*f4a2713aSLionel Sambuc// CHECK-CC7: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is getter = ReadonlyGetter)
92*f4a2713aSLionel Sambuc
93