2012-12-04 08:47:33 +08:00
|
|
|
// RUN: rm -rf %t
|
|
|
|
// RUN: mkdir %t
|
2012-12-04 09:03:31 +08:00
|
|
|
// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s > %t/out
|
2012-12-04 08:47:33 +08:00
|
|
|
// RUN: FileCheck %s < %t/out
|
|
|
|
|
|
|
|
// Ensure that XML we generate is not invalid.
|
|
|
|
// RUN: FileCheck %s -check-prefix=WRONG < %t/out
|
|
|
|
// WRONG-NOT: CommentXMLInvalid
|
|
|
|
|
|
|
|
// rdar://12378714
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief This is a protocol definition
|
|
|
|
*/
|
|
|
|
@protocol MyProto
|
|
|
|
@optional
|
|
|
|
/**
|
|
|
|
* \brief MethodMyProto method
|
|
|
|
* \param[in] anObject input value
|
|
|
|
* \param[in] range output value is unsigned int
|
|
|
|
* \result return index
|
|
|
|
*/
|
2015-06-20 02:14:38 +08:00
|
|
|
- (unsigned int)MethodMyProto:(nullable id)anObject inRange:(unsigned int)range;
|
2012-12-04 08:47:33 +08:00
|
|
|
/**
|
|
|
|
* \brief PropertyMyProto - This is protocol's property.
|
|
|
|
*/
|
2015-06-20 02:14:38 +08:00
|
|
|
@property (copy, nonnull) id PropertyMyProto;
|
2012-12-04 08:47:33 +08:00
|
|
|
/**
|
|
|
|
* \brief ClassMethodMyProto
|
|
|
|
*/
|
|
|
|
+ ClassMethodMyProto;
|
|
|
|
@end
|
2013-01-10 05:15:03 +08:00
|
|
|
// CHECK: <Declaration>@protocol MyProto\n@end</Declaration>
|
2015-06-20 02:14:38 +08:00
|
|
|
// CHECK: <Declaration>- (unsigned int)MethodMyProto:(nullable id)anObject inRange:(unsigned int)range;</Declaration>
|
2019-04-09 03:52:45 +08:00
|
|
|
// CHECK: <Declaration>@optional\n@property(atomic, copy, readwrite, nonnull) id PropertyMyProto;</Declaration>
|
2012-12-21 03:54:13 +08:00
|
|
|
// CHECK: <Declaration>+ (id)ClassMethodMyProto;</Declaration>
|
2012-12-04 08:47:33 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief NSObject is the root class.
|
|
|
|
*/
|
|
|
|
@interface NSObject {
|
|
|
|
/**
|
|
|
|
* \brief IvarNSObject
|
|
|
|
*/
|
|
|
|
id IvarNSObject;
|
|
|
|
}
|
|
|
|
@end
|
2013-01-12 03:17:44 +08:00
|
|
|
// CHECK: Declaration>@interface NSObject {\n id IvarNSObject;\n}\n@end</Declaration>
|
2012-12-04 08:47:33 +08:00
|
|
|
// CHECK: <Declaration>id IvarNSObject</Declaration>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief MyClass - primary class.
|
|
|
|
*/
|
|
|
|
@interface MyClass : NSObject<MyProto>
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* \brief IvarMyClass - IvarMyClass of values.
|
|
|
|
*/
|
|
|
|
id IvarMyClass;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* \brief MethodMyClass is instance method.
|
|
|
|
*/
|
|
|
|
- MethodMyClass;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief ClassMethodMyClass is class method.
|
|
|
|
*/
|
|
|
|
+ ClassMethodMyClass;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief PropertyMyClass - This is class's property.
|
|
|
|
*/
|
|
|
|
@property (copy) id PropertyMyClass;
|
|
|
|
@end
|
2013-01-12 03:17:44 +08:00
|
|
|
// CHECK: <Declaration>@interface MyClass : NSObject <MyProto> {\n id IvarMyClass;\n}\n@end</Declaration>
|
2012-12-04 08:47:33 +08:00
|
|
|
// CHECK: <Declaration>id IvarMyClass</Declaration>
|
2012-12-21 03:54:13 +08:00
|
|
|
// CHECK: <Declaration>- (id)MethodMyClass;</Declaration>
|
|
|
|
// CHECK: <Declaration>+ (id)ClassMethodMyClass;</Declaration>
|
2019-04-09 03:52:45 +08:00
|
|
|
// CHECK: <Declaration>@property(atomic, copy, readwrite) id PropertyMyClass;</Declaration
|
2012-12-04 08:47:33 +08:00
|
|
|
|
2012-12-05 02:25:34 +08:00
|
|
|
/**
|
|
|
|
* \brief - This is class extension of MyClass
|
|
|
|
*/
|
|
|
|
@interface MyClass()
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* \brief IvarMyClassExtension - IvarMyClassExtension private to class extension
|
|
|
|
*/
|
|
|
|
id IvarMyClassExtension;
|
|
|
|
}
|
|
|
|
@end
|
2013-01-12 03:17:44 +08:00
|
|
|
// CHECK: <Declaration>@interface MyClass () {\n id IvarMyClassExtension;\n}\n@end</Declaration>
|
2012-12-05 02:25:34 +08:00
|
|
|
// CHECK: <Declaration>id IvarMyClassExtension</Declaration>
|
|
|
|
|
|
|
|
|
2012-12-04 08:47:33 +08:00
|
|
|
/**
|
|
|
|
* \brief MyClass (Category) is private to MyClass.
|
|
|
|
*/
|
|
|
|
@interface MyClass (Category)
|
|
|
|
/**
|
|
|
|
* \brief This is private to MyClass
|
|
|
|
*/
|
|
|
|
- (void)MethodMyClassCategory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief PropertyMyClassCategory - This is class's private property.
|
|
|
|
*/
|
|
|
|
@property (copy) id PropertyMyClassCategory;
|
|
|
|
@end
|
2013-01-11 03:19:14 +08:00
|
|
|
// CHECK: <Declaration>@interface MyClass (Category)\n@end</Declaration>
|
2012-12-21 03:54:13 +08:00
|
|
|
// CHECK: <Declaration>- (void)MethodMyClassCategory;</Declaration>
|
2019-04-09 03:52:45 +08:00
|
|
|
// CHECK: <Declaration>@property(atomic, copy, readwrite) id PropertyMyClassCategory;</Declaration>
|
2012-12-21 03:54:13 +08:00
|
|
|
// CHECK: <Declaration>- (id)PropertyMyClassCategory;</Declaration>
|
|
|
|
// CHECK: <Declaration>- (void)setPropertyMyClassCategory:(id)arg;</Declaration>
|
2012-12-04 08:47:33 +08:00
|
|
|
|
|
|
|
/// @implementation's
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief implementation of MyClass class.
|
|
|
|
*/
|
|
|
|
@implementation MyClass {
|
|
|
|
/**
|
|
|
|
* \brief IvarPrivateToMyClassImpl.
|
|
|
|
*/
|
|
|
|
id IvarPrivateToMyClassImpl;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* \brief MethodMyClass is instance method implementation.
|
|
|
|
*/
|
|
|
|
- MethodMyClass {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief ClassMethodMyClass is class method implementation.
|
|
|
|
*/
|
|
|
|
+ ClassMethodMyClass {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
@end
|
2012-12-21 03:54:13 +08:00
|
|
|
// CHECK: <Declaration>@implementation MyClass {\n id IvarPrivateToMyClassImpl;\n id _PropertyMyClass;\n}\n@end</Declaration>
|
2012-12-04 08:47:33 +08:00
|
|
|
// CHECK: <Declaration>id IvarPrivateToMyClassImpl</Declaration>
|
2012-12-21 03:54:13 +08:00
|
|
|
// CHECK: <Declaration>- (id)MethodMyClass;</Declaration>
|
|
|
|
// CHECK: <Declaration>+ (id)ClassMethodMyClass;</Declaration>
|
2012-12-04 08:47:33 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief MyClass (Category) is implementation of private to MyClass.
|
|
|
|
*/
|
|
|
|
@implementation MyClass (Category)
|
|
|
|
/**
|
|
|
|
* \brief This is private to MyClass
|
|
|
|
*/
|
|
|
|
- (void)MethodMyClassCategory {}
|
|
|
|
/**
|
|
|
|
* \brief property getter
|
|
|
|
*/
|
|
|
|
- (id) PropertyMyClassCategory { return 0; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief property setter
|
|
|
|
*/
|
|
|
|
- (void) setPropertyMyClassCategory : (id) arg {}
|
|
|
|
@end
|
2013-01-11 03:19:14 +08:00
|
|
|
// CHECK: <Declaration>@implementation MyClass (Category)\n@end</Declaration>
|
2012-12-21 03:54:13 +08:00
|
|
|
// CHECK: <Declaration>- (void)MethodMyClassCategory;</Declaration>
|
|
|
|
// CHECK: <Declaration>- (id)PropertyMyClassCategory;</Declaration>
|
|
|
|
// CHECK: <Declaration>- (void)setPropertyMyClassCategory:(id)arg;</Declaration>
|
2012-12-04 08:47:33 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief NSObject implementation
|
|
|
|
*/
|
|
|
|
@implementation NSObject
|
|
|
|
@end
|
2013-01-10 07:25:37 +08:00
|
|
|
// CHECK: <Declaration>@implementation NSObject\n@end</Declaration>
|