blob: d7dce364e20836cef4252821a2fe0ec425e46613 [file] [log] [blame]
Dmitri Gribenkoc95468f2013-04-10 16:31:58 +00001// Run lines are sensitive to line numbers and come below the code.
2
3#ifndef HEADER
4#define HEADER
5
6// Not a Doxygen comment. notdoxy1 NOT_DOXYGEN
7void notdoxy1(void);
8
9/* Not a Doxygen comment. notdoxy2 NOT_DOXYGEN */
10void notdoxy2(void);
11
12/*/ Not a Doxygen comment. notdoxy3 NOT_DOXYGEN */
13void notdoxy3(void);
14
15/** Doxygen comment. isdoxy4 IS_DOXYGEN_SINGLE */
16void isdoxy4(void);
17
18/* BLOCK_ORDINARY_COMMENT */
19// ORDINARY COMMENT
20/// This is a BCPL comment. IS_DOXYGEN_START
21/// It has only two lines.
22/** But there are other blocks that are part of the comment, too. IS_DOXYGEN_END */
23void multi_line_comment_plus_ordinary(int);
24
25#endif
26
27// RUN: rm -rf %t
28// RUN: mkdir %t
29
30// RUN: %clang_cc1 -fparse-all-comments -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
31
32// 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
33// RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
34
35// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
36// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch
37
38// Ensure that XML is not invalid
39// WRONG-NOT: CommentXMLInvalid
40
41// RUN: FileCheck %s < %t/out.c-index-direct
42// RUN: FileCheck %s < %t/out.c-index-pch
43
44// CHECK: parse-all-comments.c:7:6: FunctionDecl=notdoxy1:{{.*}} notdoxy1 NOT_DOXYGEN
45// CHECK: parse-all-comments.c:10:6: FunctionDecl=notdoxy2:{{.*}} notdoxy2 NOT_DOXYGEN
46// CHECK: parse-all-comments.c:13:6: FunctionDecl=notdoxy3:{{.*}} notdoxy3 NOT_DOXYGEN
47// CHECK: parse-all-comments.c:16:6: FunctionDecl=isdoxy4:{{.*}} isdoxy4 IS_DOXYGEN_SINGLE
48// CHECK: parse-all-comments.c:23:6: FunctionDecl=multi_line_comment_plus_ordinary:{{.*}} BLOCK_ORDINARY_COMMENT {{.*}} ORDINARY COMMENT {{.*}} IS_DOXYGEN_START {{.*}} IS_DOXYGEN_END