summaryrefslogtreecommitdiffstats
path: root/test/Index/subclass-comment.mm
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-04-26 23:34:36 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-04-26 23:34:36 +0000
commit91efca0fa2ef5e63b48692e3439f5c6e6bde350c (patch)
treeb5f5248c4c69b4abd89197c4e3522f928c5bd4c0 /test/Index/subclass-comment.mm
parentfff418b1abea921685a1175a8ee0b597594bddc1 (diff)
documenttion parsing. Provide a c-index test
and limit comment extraction to public c++ bases. // rdar://13647476 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/subclass-comment.mm')
-rw-r--r--test/Index/subclass-comment.mm107
1 files changed, 107 insertions, 0 deletions
diff --git a/test/Index/subclass-comment.mm b/test/Index/subclass-comment.mm
new file mode 100644
index 0000000000..9682a9f71d
--- /dev/null
+++ b/test/Index/subclass-comment.mm
@@ -0,0 +1,107 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s > %t/out
+// RUN: FileCheck %s < %t/out
+// rdar://13647476
+
+//! NSObject is root of all.
+@interface NSObject
+@end
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ NSObject is root of all.])))]
+
+//! An umbrella class for super classes.
+@interface SuperClass
+@end
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ An umbrella class for super classes.])))]
+
+@interface SubClass : SuperClass
+@end
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ An umbrella class for super classes.])))]
+
+@interface SubSubClass : SubClass
+@end
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ An umbrella class for super classes.])))]
+
+@interface SubSubClass (Private)
+@end
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ An umbrella class for super classes.])))]
+
+//! Something valuable to the organization.
+class Asset {
+};
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Something valuable to the organization.])))]
+
+//! An individual human or human individual.
+class Person : public Asset {
+};
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ An individual human or human individual.])))]
+
+class Student : public Person {
+};
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ An individual human or human individual.])))]
+
+//! Every thing is a part
+class Parts {
+};
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Every thing is a part])))]
+
+class Window : public virtual Parts {
+};
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Every thing is a part])))]
+
+class Door : public virtual Parts {
+};
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Every thing is a part])))]
+
+class House : public Window, Door {
+};
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Every thing is a part])))]
+
+//! Any Material
+class Material : virtual Parts {
+};
+
+class Building : Window, public Material {
+};
+// CHECK: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Any Material])))]
+
+