xref: /minix3/external/bsd/llvm/dist/clang/test/Index/parse-all-comments.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // Run lines are sensitive to line numbers and come below the code.
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc #ifndef HEADER
4*f4a2713aSLionel Sambuc #define HEADER
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc // Not a Doxygen comment.  notdoxy1 NOT_DOXYGEN
7*f4a2713aSLionel Sambuc void notdoxy1(void);
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc /* Not a Doxygen comment.  notdoxy2 NOT_DOXYGEN */
10*f4a2713aSLionel Sambuc void notdoxy2(void);
11*f4a2713aSLionel Sambuc 
12*f4a2713aSLionel Sambuc /*/ Not a Doxygen comment.  notdoxy3 NOT_DOXYGEN */
13*f4a2713aSLionel Sambuc void notdoxy3(void);
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc /** Doxygen comment.  isdoxy4 IS_DOXYGEN_SINGLE */
16*f4a2713aSLionel Sambuc void isdoxy4(void);
17*f4a2713aSLionel Sambuc 
18*f4a2713aSLionel Sambuc /*! Doxygen comment.  isdoxy5 IS_DOXYGEN_SINGLE */
19*f4a2713aSLionel Sambuc void isdoxy5(void);
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc /// Doxygen comment.  isdoxy6 IS_DOXYGEN_SINGLE
22*f4a2713aSLionel Sambuc void isdoxy6(void);
23*f4a2713aSLionel Sambuc 
24*f4a2713aSLionel Sambuc /* BLOCK_ORDINARY_COMMENT */
25*f4a2713aSLionel Sambuc // ORDINARY COMMENT
26*f4a2713aSLionel Sambuc /// This is a BCPL comment. IS_DOXYGEN_START
27*f4a2713aSLionel Sambuc /// It has only two lines.
28*f4a2713aSLionel Sambuc /** But there are other blocks that are part of the comment, too.  IS_DOXYGEN_END */
29*f4a2713aSLionel Sambuc void multi_line_comment_plus_ordinary(int);
30*f4a2713aSLionel Sambuc 
31*f4a2713aSLionel Sambuc // MULTILINE COMMENT
32*f4a2713aSLionel Sambuc //
33*f4a2713aSLionel Sambuc // WITH EMPTY LINE
34*f4a2713aSLionel Sambuc void multi_line_comment_empty_line(int);
35*f4a2713aSLionel Sambuc 
36*f4a2713aSLionel Sambuc #endif
37*f4a2713aSLionel Sambuc 
38*f4a2713aSLionel Sambuc // RUN: rm -rf %t
39*f4a2713aSLionel Sambuc // RUN: mkdir %t
40*f4a2713aSLionel Sambuc 
41*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fparse-all-comments -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
42*f4a2713aSLionel Sambuc 
43*f4a2713aSLionel Sambuc // 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
44*f4a2713aSLionel Sambuc // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
45*f4a2713aSLionel Sambuc 
46*f4a2713aSLionel Sambuc // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
47*f4a2713aSLionel Sambuc // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch
48*f4a2713aSLionel Sambuc 
49*f4a2713aSLionel Sambuc // Ensure that XML is not invalid
50*f4a2713aSLionel Sambuc // WRONG-NOT: CommentXMLInvalid
51*f4a2713aSLionel Sambuc 
52*f4a2713aSLionel Sambuc // RUN: FileCheck %s < %t/out.c-index-direct
53*f4a2713aSLionel Sambuc // RUN: FileCheck %s < %t/out.c-index-pch
54*f4a2713aSLionel Sambuc 
55*f4a2713aSLionel Sambuc // CHECK: parse-all-comments.c:7:6: FunctionDecl=notdoxy1:{{.*}} notdoxy1 NOT_DOXYGEN
56*f4a2713aSLionel Sambuc // CHECK: parse-all-comments.c:10:6: FunctionDecl=notdoxy2:{{.*}} notdoxy2 NOT_DOXYGEN
57*f4a2713aSLionel Sambuc // CHECK: parse-all-comments.c:13:6: FunctionDecl=notdoxy3:{{.*}} notdoxy3 NOT_DOXYGEN
58*f4a2713aSLionel Sambuc // CHECK: parse-all-comments.c:16:6: FunctionDecl=isdoxy4:{{.*}} isdoxy4 IS_DOXYGEN_SINGLE
59*f4a2713aSLionel Sambuc // CHECK: parse-all-comments.c:19:6: FunctionDecl=isdoxy5:{{.*}} isdoxy5 IS_DOXYGEN_SINGLE
60*f4a2713aSLionel Sambuc // CHECK: parse-all-comments.c:22:6: FunctionDecl=isdoxy6:{{.*}} isdoxy6 IS_DOXYGEN_SINGLE
61*f4a2713aSLionel Sambuc // CHECK: parse-all-comments.c:29:6: FunctionDecl=multi_line_comment_plus_ordinary:{{.*}} BLOCK_ORDINARY_COMMENT {{.*}} ORDINARY COMMENT {{.*}} IS_DOXYGEN_START {{.*}} IS_DOXYGEN_END
62*f4a2713aSLionel Sambuc // CHECK: parse-all-comments.c:34:6: FunctionDecl=multi_line_comment_empty_line:{{.*}} MULTILINE COMMENT{{.*}}\n{{.*}}\n{{.*}} WITH EMPTY LINE
63