Dmitri Gribenko | c95468f | 2013-04-10 16:31:58 +0000 | [diff] [blame] | 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 |
| 7 | void notdoxy1(void); |
| 8 | |
| 9 | /* Not a Doxygen comment. notdoxy2 NOT_DOXYGEN */ |
| 10 | void notdoxy2(void); |
| 11 | |
| 12 | /*/ Not a Doxygen comment. notdoxy3 NOT_DOXYGEN */ |
| 13 | void notdoxy3(void); |
| 14 | |
| 15 | /** Doxygen comment. isdoxy4 IS_DOXYGEN_SINGLE */ |
| 16 | void isdoxy4(void); |
| 17 | |
Dmitri Gribenko | 0e7f2bb | 2013-04-10 18:43:09 +0000 | [diff] [blame] | 18 | /*! Doxygen comment. isdoxy5 IS_DOXYGEN_SINGLE */ |
| 19 | void isdoxy5(void); |
| 20 | |
| 21 | /// Doxygen comment. isdoxy6 IS_DOXYGEN_SINGLE |
| 22 | void isdoxy6(void); |
| 23 | |
Dmitri Gribenko | c95468f | 2013-04-10 16:31:58 +0000 | [diff] [blame] | 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 */ |
| 29 | void multi_line_comment_plus_ordinary(int); |
| 30 | |
Dmitri Gribenko | 002f928 | 2013-04-26 20:12:49 +0000 | [diff] [blame] | 31 | // MULTILINE COMMENT |
| 32 | // |
| 33 | // WITH EMPTY LINE |
| 34 | void multi_line_comment_empty_line(int); |
| 35 | |
James Dennett | 563f230 | 2015-07-15 19:13:39 +0000 | [diff] [blame] | 36 | int notdoxy7; // Not a Doxygen juxtaposed comment. notdoxy7 NOT_DOXYGEN |
| 37 | int notdoxy8; // Not a Doxygen juxtaposed comment. notdoxy8 NOT_DOXYGEN |
| 38 | |
| 39 | int trdoxy9; /// A Doxygen non-trailing comment. trdoxyA IS_DOXYGEN_SINGLE |
| 40 | int trdoxyA; |
| 41 | |
| 42 | int trdoxyB; // Not a Doxygen trailing comment. PART_ONE |
| 43 | // It's a multiline one too. trdoxyB NOT_DOXYGEN |
| 44 | int trdoxyC; |
| 45 | |
| 46 | int trdoxyD; // Not a Doxygen trailing comment. trdoxyD NOT_DOXYGEN |
| 47 | /// This comment doesn't get merged. trdoxyE IS_DOXYGEN |
| 48 | int trdoxyE; |
| 49 | |
| 50 | int trdoxyF; /// A Doxygen non-trailing comment that gets dropped on the floor. |
| 51 | // This comment will also be dropped. |
| 52 | int trdoxyG; // This one won't. trdoxyG NOT_DOXYGEN |
| 53 | |
| 54 | int trdoxyH; ///< A Doxygen trailing comment. PART_ONE |
| 55 | // This one gets merged with it. trdoxyH SOME_DOXYGEN |
| 56 | int trdoxyI; // This one doesn't. trdoxyI NOT_DOXYGEN |
| 57 | |
| 58 | int trdoxyJ; // Not a Doxygen trailing comment. PART_ONE |
| 59 | ///< This one gets merged with it. trdoxyJ SOME_DOXYGEN |
| 60 | int trdoxyK; // This one doesn't. trdoxyK NOT_DOXYGEN |
| 61 | |
| 62 | int trdoxyL; // Not a Doxygen trailing comment. trdoxyL NOT_DOXYGEN |
| 63 | // This one shouldn't get merged. trdoxyM NOT_DOXYGEN |
| 64 | int trdoxyM; |
| 65 | |
| 66 | int trdoxyN; ///< A Doxygen trailing comment. trdoxyN IS_DOXYGEN |
| 67 | // This one shouldn't get merged. trdoxyO NOT_DOXYGEN |
| 68 | int trdoxyO; |
| 69 | |
| 70 | |
Dmitri Gribenko | c95468f | 2013-04-10 16:31:58 +0000 | [diff] [blame] | 71 | #endif |
| 72 | |
| 73 | // RUN: rm -rf %t |
| 74 | // RUN: mkdir %t |
| 75 | |
Argyrios Kyrtzidis | 04421f5 | 2015-08-05 17:23:59 +0000 | [diff] [blame] | 76 | // RUN: c-index-test -write-pch %t/out.pch -fparse-all-comments -x c++ -std=c++11 %s |
Dmitri Gribenko | c95468f | 2013-04-10 16:31:58 +0000 | [diff] [blame] | 77 | |
| 78 | // 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 |
| 79 | // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch |
| 80 | |
| 81 | // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct |
| 82 | // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch |
| 83 | |
| 84 | // Ensure that XML is not invalid |
| 85 | // WRONG-NOT: CommentXMLInvalid |
| 86 | |
| 87 | // RUN: FileCheck %s < %t/out.c-index-direct |
| 88 | // RUN: FileCheck %s < %t/out.c-index-pch |
| 89 | |
| 90 | // CHECK: parse-all-comments.c:7:6: FunctionDecl=notdoxy1:{{.*}} notdoxy1 NOT_DOXYGEN |
| 91 | // CHECK: parse-all-comments.c:10:6: FunctionDecl=notdoxy2:{{.*}} notdoxy2 NOT_DOXYGEN |
| 92 | // CHECK: parse-all-comments.c:13:6: FunctionDecl=notdoxy3:{{.*}} notdoxy3 NOT_DOXYGEN |
| 93 | // CHECK: parse-all-comments.c:16:6: FunctionDecl=isdoxy4:{{.*}} isdoxy4 IS_DOXYGEN_SINGLE |
Dmitri Gribenko | 0e7f2bb | 2013-04-10 18:43:09 +0000 | [diff] [blame] | 94 | // CHECK: parse-all-comments.c:19:6: FunctionDecl=isdoxy5:{{.*}} isdoxy5 IS_DOXYGEN_SINGLE |
| 95 | // CHECK: parse-all-comments.c:22:6: FunctionDecl=isdoxy6:{{.*}} isdoxy6 IS_DOXYGEN_SINGLE |
| 96 | // CHECK: parse-all-comments.c:29:6: FunctionDecl=multi_line_comment_plus_ordinary:{{.*}} BLOCK_ORDINARY_COMMENT {{.*}} ORDINARY COMMENT {{.*}} IS_DOXYGEN_START {{.*}} IS_DOXYGEN_END |
Dmitri Gribenko | 002f928 | 2013-04-26 20:12:49 +0000 | [diff] [blame] | 97 | // CHECK: parse-all-comments.c:34:6: FunctionDecl=multi_line_comment_empty_line:{{.*}} MULTILINE COMMENT{{.*}}\n{{.*}}\n{{.*}} WITH EMPTY LINE |
James Dennett | 563f230 | 2015-07-15 19:13:39 +0000 | [diff] [blame] | 98 | // CHECK: parse-all-comments.c:36:5: VarDecl=notdoxy7:{{.*}} notdoxy7 NOT_DOXYGEN |
| 99 | // CHECK: parse-all-comments.c:37:5: VarDecl=notdoxy8:{{.*}} notdoxy8 NOT_DOXYGEN |
| 100 | // CHECK-NOT: parse-all-comments.c:39:5: VarDecl=trdoxy9:{{.*}} trdoxyA IS_DOXYGEN_SINGLE |
| 101 | // CHECK: parse-all-comments.c:40:5: VarDecl=trdoxyA:{{.*}} trdoxyA IS_DOXYGEN_SINGLE |
| 102 | // CHECK: parse-all-comments.c:42:5: VarDecl=trdoxyB:{{.*}} PART_ONE {{.*}} trdoxyB NOT_DOXYGEN |
| 103 | // CHECK-NOT: parse-all-comments.c:44:5: VarDecl=trdoxyC:{{.*}} trdoxyB NOT_DOXYGEN |
| 104 | // CHECK: parse-all-comments.c:46:5: VarDecl=trdoxyD:{{.*}} trdoxyD NOT_DOXYGEN |
| 105 | // CHECK: parse-all-comments.c:48:5: VarDecl=trdoxyE:{{.*}} trdoxyE IS_DOXYGEN |
| 106 | // CHECK-NOT: parse-all-comments.c:50:5: VarDecl=trdoxyF:{{.*}} RawComment |
| 107 | // CHECK: parse-all-comments.c:52:5: VarDecl=trdoxyG:{{.*}} trdoxyG NOT_DOXYGEN |
| 108 | // CHECK: parse-all-comments.c:54:5: VarDecl=trdoxyH:{{.*}} PART_ONE {{.*}} trdoxyH SOME_DOXYGEN |
| 109 | // CHECK: parse-all-comments.c:56:5: VarDecl=trdoxyI:{{.*}} trdoxyI NOT_DOXYGEN |
| 110 | // CHECK: parse-all-comments.c:58:5: VarDecl=trdoxyJ:{{.*}} PART_ONE {{.*}} trdoxyJ SOME_DOXYGEN |
| 111 | // CHECK: parse-all-comments.c:60:5: VarDecl=trdoxyK:{{.*}} trdoxyK NOT_DOXYGEN |
| 112 | // CHECK: parse-all-comments.c:62:5: VarDecl=trdoxyL:{{.*}} trdoxyL NOT_DOXYGEN |
| 113 | // CHECK: parse-all-comments.c:64:5: VarDecl=trdoxyM:{{.*}} trdoxyM NOT_DOXYGEN |
| 114 | // CHECK: parse-all-comments.c:66:5: VarDecl=trdoxyN:{{.*}} trdoxyN IS_DOXYGEN |
| 115 | // CHECK: parse-all-comments.c:68:5: VarDecl=trdoxyO:{{.*}} trdoxyO NOT_DOXYGEN |