xref: /minix3/external/bsd/llvm/dist/clang/test/Index/annotate-comments-property-accessor.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: rm -rf %t
2*f4a2713aSLionel Sambuc// RUN: mkdir %t
3*f4a2713aSLionel Sambuc// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s > %t/out
4*f4a2713aSLionel Sambuc// RUN: FileCheck %s < %t/out
5*f4a2713aSLionel Sambuc// rdar://12378879
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc// Ensure that XML we generate is not invalid.
8*f4a2713aSLionel Sambuc// RUN: FileCheck %s -check-prefix=WRONG < %t/out
9*f4a2713aSLionel Sambuc// WRONG-NOT: CommentXMLInvalid
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambuc@interface AppDelegate
12*f4a2713aSLionel Sambuc/**
13*f4a2713aSLionel Sambuc  \brief This is ReadonlyProperty
14*f4a2713aSLionel Sambuc*/
15*f4a2713aSLionel Sambuc@property (readonly, getter = ReadonlyGetter) int MyProperty;
16*f4a2713aSLionel Sambuc// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-1]]" column="51"><Name>MyProperty</Name><USR>c:objc(cs)AppDelegate(py)MyProperty</USR><Declaration>- (int)ReadonlyGetter;</Declaration><Abstract><Para> This is ReadonlyProperty</Para></Abstract></Function>]
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc/**
19*f4a2713aSLionel Sambuc  \brief This is GeneralProperty
20*f4a2713aSLionel Sambuc*/
21*f4a2713aSLionel Sambuc@property int GeneralProperty;
22*f4a2713aSLionel Sambuc// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-1]]" column="15"><Name>GeneralProperty</Name><USR>c:objc(cs)AppDelegate(py)GeneralProperty</USR><Declaration>- (int)GeneralProperty;</Declaration><Abstract><Para> This is GeneralProperty</Para></Abstract></Function>]
23*f4a2713aSLionel Sambuc// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-2]]" column="15"><Name>GeneralProperty</Name><USR>c:objc(cs)AppDelegate(py)GeneralProperty</USR><Declaration>- (void)setGeneralProperty:(int)GeneralProperty;</Declaration><Abstract><Para> This is GeneralProperty</Para></Abstract></Function>]
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc/**
26*f4a2713aSLionel Sambuc  \brief This is PropertyInPrimaryClass
27*f4a2713aSLionel Sambuc*/
28*f4a2713aSLionel Sambuc@property (copy, nonatomic) id PropertyInPrimaryClass;
29*f4a2713aSLionel Sambuc- (void) setThisRecord : (id)arg;
30*f4a2713aSLionel Sambuc- (id) Record;
31*f4a2713aSLionel Sambuc@end
32*f4a2713aSLionel Sambuc// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-4]]" column="32"><Name>PropertyInPrimaryClass</Name><USR>c:objc(cs)AppDelegate(py)PropertyInPrimaryClass</USR><Declaration>- (id)PropertyInPrimaryClass;</Declaration><Abstract><Para> This is PropertyInPrimaryClass</Para></Abstract></Function>]
33*f4a2713aSLionel Sambuc// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-5]]" column="32"><Name>PropertyInPrimaryClass</Name><USR>c:objc(cs)AppDelegate(py)PropertyInPrimaryClass</USR><Declaration>- (void)setPropertyInPrimaryClass:(id)PropertyInPrimaryClass;</Declaration><Abstract><Para> This is PropertyInPrimaryClass</Para></Abstract></Function>]
34*f4a2713aSLionel Sambuc
35*f4a2713aSLionel Sambuc@interface AppDelegate()
36*f4a2713aSLionel Sambuc- (id) GetterInClassExtension;
37*f4a2713aSLionel Sambuc/**
38*f4a2713aSLionel Sambuc  \brief This is Record
39*f4a2713aSLionel Sambuc*/
40*f4a2713aSLionel Sambuc@property (copy, setter = setThisRecord:) id Record;
41*f4a2713aSLionel Sambuc@end
42*f4a2713aSLionel Sambuc// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-6]]" column="1"><Name>PropertyInClassExtension</Name><USR>c:objc(cs)AppDelegate(py)PropertyInClassExtension</USR><Declaration>- (id)GetterInClassExtension;</Declaration><Abstract><Para> This is PropertyInClassExtension</Para></Abstract></Function>]
43*f4a2713aSLionel Sambuc
44*f4a2713aSLionel Sambuc@interface AppDelegate()
45*f4a2713aSLionel Sambuc/**
46*f4a2713aSLionel Sambuc  \brief This is PropertyInClassExtension
47*f4a2713aSLionel Sambuc*/
48*f4a2713aSLionel Sambuc@property (copy, getter = GetterInClassExtension) id PropertyInClassExtension;
49*f4a2713aSLionel Sambuc
50*f4a2713aSLionel Sambuc- (id) PropertyInPrimaryClass;
51*f4a2713aSLionel Sambuc@end
52*f4a2713aSLionel Sambuc// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-4]]" column="54"><Name>PropertyInClassExtension</Name><USR>c:objc(cs)AppDelegate(py)PropertyInClassExtension</USR><Declaration>- (id)GetterInClassExtension;</Declaration><Abstract><Para> This is PropertyInClassExtension</Para></Abstract></Function>]
53*f4a2713aSLionel Sambuc// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-5]]" column="54"><Name>PropertyInClassExtension</Name><USR>c:objc(cs)AppDelegate(py)PropertyInClassExtension</USR><Declaration>- (void)setPropertyInClassExtension:(id)PropertyInClassExtension;</Declaration><Abstract><Para> This is PropertyInClassExtension</Para></Abstract></Function>]
54*f4a2713aSLionel Sambuc
55*f4a2713aSLionel Sambuc@implementation AppDelegate
56*f4a2713aSLionel Sambuc- (id) PropertyInPrimaryClass { return 0; }
57*f4a2713aSLionel Sambuc@end
58*f4a2713aSLionel Sambuc
59*f4a2713aSLionel Sambuc
60*f4a2713aSLionel Sambuc
61*f4a2713aSLionel Sambuc
62*f4a2713aSLionel Sambuc
63