From 809500fc2c13c8173a16b052304d983864e4a1e1 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 8 Apr 2013 18:45:10 +0000 Subject: Vendor import of clang trunk r178860: http://llvm.org/svn/llvm-project/cfe/trunk@178860 --- test/Index/comment-c-decls.c | 104 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 test/Index/comment-c-decls.c (limited to 'test/Index/comment-c-decls.c') diff --git a/test/Index/comment-c-decls.c b/test/Index/comment-c-decls.c new file mode 100644 index 0000000000000..371e453bef4f1 --- /dev/null +++ b/test/Index/comment-c-decls.c @@ -0,0 +1,104 @@ +// 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 -target x86_64-apple-darwin10 %s > %t/out +// 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 Aaa. +*/ +int global_function(); +// CHECK: int global_function() + +/** + * \param x1 Aaa. +*/ +extern void external_function(int x1); +// CHECK: extern void external_function(int x1) + +/** + * \brief global variable; +*/ +int global_variable; +// CHECK: int global_variable + +/** + * \brief local variable; +*/ +static int static_variable; +// CHECK: static int static_variable + +/** + * \brief external variable +*/ +extern int external_variable; +// CHECK: extern int external_variable + +int global_function() { + /** + * \brief a local variable + */ + int local = 10; + return local; +} +// CHECK: int global_function() +// CHECK: int local = 10 + +/** + * \brief initialized decl. +*/ +int initialized_global = 100; +// CHECK: int initialized_global = 100 + +/** + * \brief typedef example +*/ +typedef int INT_T; +// CHECK: typedef int INT_T + +/** + * \brief aggregate type example +*/ +struct S { +/** + * \brief iS1; +*/ + int iS1; +/** + * \brief dS1; +*/ + double dS1; +}; +// CHECK: struct S {} +// CHECK: int iS1 +// CHECK: double dS1 + +/** + * \brief enum e; +*/ +enum e { + One, +/** + * \brief Two; +*/ + Two, + Three +}; +// CHECK: enum e {} +// CHECK: Two + +/** + *\brief block declaration +*/ +int (^Block) (int i, int j); +// CHECK: int (^Block)(int, int) + +/** + *\brief block declaration +*/ +int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; }; +// CHECK: int (^Block1)(int, int) = ^(int i, int j) {} -- cgit v1.2.3