parse-all-comments.c revision 0e7f2bb1810a4e5e62a8e247460cd26f981d0827
1// 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/*! Doxygen comment.  isdoxy5 IS_DOXYGEN_SINGLE */
19void isdoxy5(void);
20
21/// Doxygen comment.  isdoxy6 IS_DOXYGEN_SINGLE
22void isdoxy6(void);
23
24/* BLOCK_ORDINARY_COMMENT */
25// ORDINARY COMMENT
26/// This is a BCPL comment. IS_DOXYGEN_START
27/// It has only two lines.
28/** But there are other blocks that are part of the comment, too.  IS_DOXYGEN_END */
29void multi_line_comment_plus_ordinary(int);
30
31#endif
32
33// RUN: rm -rf %t
34// RUN: mkdir %t
35
36// RUN: %clang_cc1 -fparse-all-comments -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
37
38// 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
39// RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
40
41// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
42// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch
43
44// Ensure that XML is not invalid
45// WRONG-NOT: CommentXMLInvalid
46
47// RUN: FileCheck %s < %t/out.c-index-direct
48// RUN: FileCheck %s < %t/out.c-index-pch
49
50// CHECK: parse-all-comments.c:7:6: FunctionDecl=notdoxy1:{{.*}} notdoxy1 NOT_DOXYGEN
51// CHECK: parse-all-comments.c:10:6: FunctionDecl=notdoxy2:{{.*}} notdoxy2 NOT_DOXYGEN
52// CHECK: parse-all-comments.c:13:6: FunctionDecl=notdoxy3:{{.*}} notdoxy3 NOT_DOXYGEN
53// CHECK: parse-all-comments.c:16:6: FunctionDecl=isdoxy4:{{.*}} isdoxy4 IS_DOXYGEN_SINGLE
54// CHECK: parse-all-comments.c:19:6: FunctionDecl=isdoxy5:{{.*}} isdoxy5 IS_DOXYGEN_SINGLE
55// CHECK: parse-all-comments.c:22:6: FunctionDecl=isdoxy6:{{.*}} isdoxy6 IS_DOXYGEN_SINGLE
56// CHECK: parse-all-comments.c:29:6: FunctionDecl=multi_line_comment_plus_ordinary:{{.*}} BLOCK_ORDINARY_COMMENT {{.*}} ORDINARY COMMENT {{.*}} IS_DOXYGEN_START {{.*}} IS_DOXYGEN_END
57