r179181 - Add testcases for -fparse-all-comments

Dmitri Gribenko gribozavr at gmail.com
Wed Apr 10 09:31:59 PDT 2013


Author: gribozavr
Date: Wed Apr 10 11:31:58 2013
New Revision: 179181

URL: http://llvm.org/viewvc/llvm-project?rev=179181&view=rev
Log:
Add testcases for -fparse-all-comments

Added:
    cfe/trunk/test/Driver/fparse-all-comments.c
    cfe/trunk/test/Index/parse-all-comments.c

Added: cfe/trunk/test/Driver/fparse-all-comments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fparse-all-comments.c?rev=179181&view=auto
==============================================================================
--- cfe/trunk/test/Driver/fparse-all-comments.c (added)
+++ cfe/trunk/test/Driver/fparse-all-comments.c Wed Apr 10 11:31:58 2013
@@ -0,0 +1,5 @@
+// Check that we pass -fparse-all-comments to frontend.
+//
+// RUN: %clang -c %s -fparse-all-comments -### 2>&1 | FileCheck %s --check-prefix=CHECK-ARG
+//
+// CHECK-ARG: -fparse-all-comments

Added: cfe/trunk/test/Index/parse-all-comments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/parse-all-comments.c?rev=179181&view=auto
==============================================================================
--- cfe/trunk/test/Index/parse-all-comments.c (added)
+++ cfe/trunk/test/Index/parse-all-comments.c Wed Apr 10 11:31:58 2013
@@ -0,0 +1,48 @@
+// Run lines are sensitive to line numbers and come below the code.
+
+#ifndef HEADER
+#define HEADER
+
+// Not a Doxygen comment.  notdoxy1 NOT_DOXYGEN
+void notdoxy1(void);
+
+/* Not a Doxygen comment.  notdoxy2 NOT_DOXYGEN */
+void notdoxy2(void);
+
+/*/ Not a Doxygen comment.  notdoxy3 NOT_DOXYGEN */
+void notdoxy3(void);
+
+/** Doxygen comment.  isdoxy4 IS_DOXYGEN_SINGLE */
+void isdoxy4(void);
+
+/* BLOCK_ORDINARY_COMMENT */
+// ORDINARY COMMENT
+/// This is a BCPL comment. IS_DOXYGEN_START
+/// It has only two lines.
+/** But there are other blocks that are part of the comment, too.  IS_DOXYGEN_END */
+void multi_line_comment_plus_ordinary(int);
+
+#endif
+
+// RUN: rm -rf %t
+// RUN: mkdir %t
+
+// RUN: %clang_cc1 -fparse-all-comments -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
+
+// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 -fparse-all-comments > %t/out.c-index-direct
+// RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
+
+// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
+// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch
+
+// Ensure that XML is not invalid
+// WRONG-NOT: CommentXMLInvalid
+
+// RUN: FileCheck %s < %t/out.c-index-direct
+// RUN: FileCheck %s < %t/out.c-index-pch
+
+// CHECK: parse-all-comments.c:7:6: FunctionDecl=notdoxy1:{{.*}} notdoxy1 NOT_DOXYGEN
+// CHECK: parse-all-comments.c:10:6: FunctionDecl=notdoxy2:{{.*}} notdoxy2 NOT_DOXYGEN
+// CHECK: parse-all-comments.c:13:6: FunctionDecl=notdoxy3:{{.*}} notdoxy3 NOT_DOXYGEN
+// CHECK: parse-all-comments.c:16:6: FunctionDecl=isdoxy4:{{.*}} isdoxy4 IS_DOXYGEN_SINGLE
+// CHECK: parse-all-comments.c:23:6: FunctionDecl=multi_line_comment_plus_ordinary:{{.*}} BLOCK_ORDINARY_COMMENT {{.*}} ORDINARY COMMENT {{.*}} IS_DOXYGEN_START {{.*}} IS_DOXYGEN_END





More information about the cfe-commits mailing list