Dmitri Gribenko | aa0cd85 | 2012-06-20 00:34: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. NOT_DOXYGEN |
| 7 | void notdoxy1(void); |
| 8 | |
| 9 | /* Not a Doxygen comment. NOT_DOXYGEN */ |
| 10 | void notdoxy2(void); |
| 11 | |
| 12 | /*/ Not a Doxygen comment. NOT_DOXYGEN */ |
| 13 | void notdoxy3(void); |
| 14 | |
| 15 | /** Doxygen comment. isdoxy4 IS_DOXYGEN_SINGLE */ |
| 16 | void isdoxy4(void); |
| 17 | |
| 18 | /** |
| 19 | * Doxygen comment. isdoxy5 IS_DOXYGEN_SINGLE */ |
| 20 | void isdoxy5(void); |
| 21 | |
| 22 | /** |
| 23 | * Doxygen comment. |
| 24 | * isdoxy6 IS_DOXYGEN_SINGLE */ |
| 25 | void isdoxy6(void); |
| 26 | |
| 27 | /** |
| 28 | * Doxygen comment. |
| 29 | * isdoxy7 IS_DOXYGEN_SINGLE |
| 30 | */ |
| 31 | void isdoxy7(void); |
| 32 | |
| 33 | /*! Doxygen comment. isdoxy8 IS_DOXYGEN_SINGLE */ |
| 34 | void isdoxy8(void); |
| 35 | |
| 36 | /// Doxygen comment. isdoxy9 IS_DOXYGEN_SINGLE |
| 37 | void isdoxy9(void); |
| 38 | |
| 39 | // Not a Doxygen comment. NOT_DOXYGEN |
| 40 | /// Doxygen comment. isdoxy10 IS_DOXYGEN_SINGLE |
| 41 | void isdoxy10(void); |
| 42 | |
| 43 | /// Doxygen comment. isdoxy11 IS_DOXYGEN_SINGLE |
| 44 | // Not a Doxygen comment. NOT_DOXYGEN |
| 45 | void isdoxy11(void); |
| 46 | |
| 47 | /** Doxygen comment. isdoxy12 IS_DOXYGEN_SINGLE */ |
| 48 | /* Not a Doxygen comment. NOT_DOXYGEN */ |
| 49 | void isdoxy12(void); |
| 50 | |
| 51 | /// Doxygen comment. isdoxy13 IS_DOXYGEN_START |
| 52 | /// Doxygen comment. IS_DOXYGEN_END |
| 53 | void isdoxy13(void); |
| 54 | |
| 55 | /// Doxygen comment. isdoxy14 IS_DOXYGEN_START |
| 56 | /// Blah-blah-blah. |
| 57 | /// Doxygen comment. IS_DOXYGEN_END |
| 58 | void isdoxy14(void); |
| 59 | |
| 60 | /// Doxygen comment. isdoxy15 IS_DOXYGEN_START |
| 61 | /** Blah-blah-blah */ |
| 62 | /// Doxygen comment. IS_DOXYGEN_END |
| 63 | void isdoxy15(void); |
| 64 | |
| 65 | /** Blah-blah-blah. isdoxy16 IS_DOXYGEN_START *//** Blah */ |
| 66 | /// Doxygen comment. IS_DOXYGEN_END |
| 67 | void isdoxy16(void); |
| 68 | |
| 69 | /// isdoxy17 IS_DOXYGEN_START |
| 70 | // Not a Doxygen comment, but still picked up. |
| 71 | /// IS_DOXYGEN_END |
| 72 | void isdoxy17(void); |
| 73 | |
| 74 | unsigned |
| 75 | // NOT_DOXYGEN |
| 76 | /// isdoxy18 IS_DOXYGEN_START |
| 77 | // Not a Doxygen comment, but still picked up. |
| 78 | /// IS_DOXYGEN_END |
| 79 | // NOT_DOXYGEN |
| 80 | int isdoxy18(void); |
| 81 | |
| 82 | //! It all starts here. isdoxy19 IS_DOXYGEN_START |
| 83 | /*! It's a little odd to continue line this, |
| 84 | * |
| 85 | * but we need more multi-line comments. */ |
| 86 | /// This comment comes before my other comments |
| 87 | /** This is a block comment that is associated with the function f. It |
| 88 | * runs for three lines. IS_DOXYGEN_END |
| 89 | */ |
| 90 | void isdoxy19(int, int); |
| 91 | |
| 92 | // NOT IN THE COMMENT NOT_DOXYGEN |
| 93 | /// This is a BCPL comment. isdoxy20 IS_DOXYGEN_START |
| 94 | /// It has only two lines. |
| 95 | /** But there are other blocks that are part of the comment, too. IS_DOXYGEN_END */ |
| 96 | void isdoxy20(int); |
| 97 | |
| 98 | void isdoxy21(int); ///< This is a member comment. isdoxy21 IS_DOXYGEN_SINGLE |
| 99 | |
| 100 | void isdoxy22(int); /*!< This is a member comment. isdoxy22 IS_DOXYGEN_SINGLE */ |
| 101 | |
| 102 | void isdoxy23(int); /**< This is a member comment. isdoxy23 IS_DOXYGEN_SINGLE */ |
| 103 | |
| 104 | void notdoxy24(int); // NOT_DOXYGEN |
| 105 | |
| 106 | /// IS_DOXYGEN_SINGLE |
| 107 | struct isdoxy25 { |
| 108 | }; |
| 109 | |
| 110 | struct test26 { |
| 111 | /// IS_DOXYGEN_SINGLE |
| 112 | int isdoxy26; |
| 113 | }; |
| 114 | |
| 115 | struct test27 { |
| 116 | int isdoxy27; ///< IS_DOXYGEN_SINGLE |
| 117 | }; |
| 118 | |
| 119 | struct notdoxy28 { |
| 120 | }; ///< IS_DOXYGEN_NOT_ATTACHED |
| 121 | |
| 122 | /// IS_DOXYGEN_SINGLE |
| 123 | enum isdoxy29 { |
| 124 | }; |
| 125 | |
| 126 | enum notdoxy30 { |
| 127 | }; ///< IS_DOXYGEN_NOT_ATTACHED |
| 128 | |
| 129 | /// IS_DOXYGEN_SINGLE |
| 130 | namespace isdoxy31 { |
| 131 | }; |
| 132 | |
| 133 | namespace notdoxy32 { |
| 134 | }; ///< IS_DOXYGEN_NOT_ATTACHED |
| 135 | |
| 136 | class test33 { |
| 137 | ///< IS_DOXYGEN_NOT_ATTACHED |
| 138 | int isdoxy33; ///< isdoxy33 IS_DOXYGEN_SINGLE |
| 139 | int isdoxy34; ///< isdoxy34 IS_DOXYGEN_SINGLE |
| 140 | |
| 141 | ///< IS_DOXYGEN_NOT_ATTACHED |
| 142 | int isdoxy35, ///< isdoxy35 IS_DOXYGEN_SINGLE |
| 143 | isdoxy36; ///< isdoxy36 IS_DOXYGEN_SINGLE |
| 144 | |
| 145 | ///< IS_DOXYGEN_NOT_ATTACHED |
| 146 | int isdoxy37 ///< isdoxy37 IS_DOXYGEN_SINGLE |
| 147 | , isdoxy38 ///< isdoxy38 IS_DOXYGEN_SINGLE |
| 148 | , isdoxy39; ///< isdoxy39 IS_DOXYGEN_SINGLE |
| 149 | }; |
| 150 | |
| 151 | // Verified that Doxygen attaches these. |
| 152 | |
| 153 | /// isdoxy40 IS_DOXYGEN_SINGLE |
| 154 | // NOT_DOXYGEN |
| 155 | void isdoxy40(int); |
| 156 | |
| 157 | unsigned |
| 158 | /// isdoxy41 IS_DOXYGEN_SINGLE |
| 159 | // NOT_DOXYGEN |
| 160 | int isdoxy41(int); |
| 161 | |
| 162 | class test42 { |
| 163 | int isdoxy42; /* NOT_DOXYGEN */ ///< isdoxy42 IS_DOXYGEN_SINGLE |
| 164 | }; |
| 165 | |
| 166 | #endif |
| 167 | |
| 168 | // RUN: rm -rf %t |
| 169 | // RUN: mkdir %t |
| 170 | // RUN: %clang_cc1 -x c++ -emit-pch -o %t/out.pch %s |
| 171 | // RUN: %clang_cc1 -x c++ -include-pch %t/out.pch -fsyntax-only %s |
| 172 | |
| 173 | // RUN: c-index-test -test-load-source all %s > %t/out.c-index-direct |
| 174 | // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch |
| 175 | |
| 176 | // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct |
| 177 | // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch |
| 178 | |
| 179 | // Declarations without Doxygen comments should not pick up some Doxygen comments. |
| 180 | // WRONG-NOT: notdoxy{{.*}}Comment= |
| 181 | // WRONG-NOT: test{{.*}}Comment= |
| 182 | |
| 183 | // Non-Doxygen comments should not be attached to anything. |
| 184 | // WRONG-NOT: NOT_DOXYGEN |
| 185 | |
| 186 | // Some Doxygen comments are not attached to anything. |
| 187 | // WRONG-NOT: IS_DOXYGEN_NOT_ATTACHED |
| 188 | |
| 189 | // Ensure we don't pick up extra comments. |
| 190 | // WRONG-NOT: IS_DOXYGEN_START{{.*}}IS_DOXYGEN_START |
| 191 | // WRONG-NOT: IS_DOXYGEN_END{{.*}}IS_DOXYGEN_END |
| 192 | |
| 193 | // RUN: FileCheck %s < %t/out.c-index-direct |
| 194 | // RUN: FileCheck %s < %t/out.c-index-pch |
| 195 | |
| 196 | // CHECK: annotate-comments.cpp:16:6: FunctionDecl=isdoxy4:{{.*}} isdoxy4 IS_DOXYGEN_SINGLE |
| 197 | // CHECK: annotate-comments.cpp:20:6: FunctionDecl=isdoxy5:{{.*}} isdoxy5 IS_DOXYGEN_SINGLE |
| 198 | // CHECK: annotate-comments.cpp:25:6: FunctionDecl=isdoxy6:{{.*}} isdoxy6 IS_DOXYGEN_SINGLE |
| 199 | // CHECK: annotate-comments.cpp:31:6: FunctionDecl=isdoxy7:{{.*}} isdoxy7 IS_DOXYGEN_SINGLE |
| 200 | // CHECK: annotate-comments.cpp:34:6: FunctionDecl=isdoxy8:{{.*}} isdoxy8 IS_DOXYGEN_SINGLE |
| 201 | // CHECK: annotate-comments.cpp:37:6: FunctionDecl=isdoxy9:{{.*}} isdoxy9 IS_DOXYGEN_SINGLE |
| 202 | // CHECK: annotate-comments.cpp:41:6: FunctionDecl=isdoxy10:{{.*}} isdoxy10 IS_DOXYGEN_SINGLE |
| 203 | // CHECK: annotate-comments.cpp:53:6: FunctionDecl=isdoxy13:{{.*}} isdoxy13 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END |
| 204 | // CHECK: annotate-comments.cpp:58:6: FunctionDecl=isdoxy14:{{.*}} isdoxy14 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END |
| 205 | // CHECK: annotate-comments.cpp:63:6: FunctionDecl=isdoxy15:{{.*}} isdoxy15 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END |
| 206 | // CHECK: annotate-comments.cpp:67:6: FunctionDecl=isdoxy16:{{.*}} isdoxy16 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END |
| 207 | // CHECK: annotate-comments.cpp:72:6: FunctionDecl=isdoxy17:{{.*}} isdoxy17 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END |
| 208 | // CHECK: annotate-comments.cpp:80:5: FunctionDecl=isdoxy18:{{.*}} isdoxy18 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END |
| 209 | // CHECK: annotate-comments.cpp:90:6: FunctionDecl=isdoxy19:{{.*}} isdoxy19 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END |
| 210 | // CHECK: annotate-comments.cpp:96:6: FunctionDecl=isdoxy20:{{.*}} isdoxy20 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END |
| 211 | // CHECK: annotate-comments.cpp:98:6: FunctionDecl=isdoxy21:{{.*}} isdoxy21 IS_DOXYGEN_SINGLE |
| 212 | // CHECK: annotate-comments.cpp:100:6: FunctionDecl=isdoxy22:{{.*}} isdoxy22 IS_DOXYGEN_SINGLE |
| 213 | // CHECK: annotate-comments.cpp:102:6: FunctionDecl=isdoxy23:{{.*}} isdoxy23 IS_DOXYGEN_SINGLE |
| 214 | // CHECK: annotate-comments.cpp:107:8: StructDecl=isdoxy25:{{.*}} IS_DOXYGEN_SINGLE |
| 215 | // CHECK: annotate-comments.cpp:112:7: FieldDecl=isdoxy26:{{.*}} IS_DOXYGEN_SINGLE |
| 216 | // CHECK: annotate-comments.cpp:116:7: FieldDecl=isdoxy27:{{.*}} IS_DOXYGEN_SINGLE |
| 217 | // CHECK: annotate-comments.cpp:123:6: EnumDecl=isdoxy29:{{.*}} IS_DOXYGEN_SINGLE |
| 218 | // CHECK: annotate-comments.cpp:130:11: Namespace=isdoxy31:{{.*}} IS_DOXYGEN_SINGLE |
| 219 | // CHECK: annotate-comments.cpp:138:7: FieldDecl=isdoxy33:{{.*}} isdoxy33 IS_DOXYGEN_SINGLE |
| 220 | // CHECK: annotate-comments.cpp:139:7: FieldDecl=isdoxy34:{{.*}} isdoxy34 IS_DOXYGEN_SINGLE |
| 221 | // CHECK: annotate-comments.cpp:142:7: FieldDecl=isdoxy35:{{.*}} isdoxy35 IS_DOXYGEN_SINGLE |
| 222 | // CHECK: annotate-comments.cpp:143:7: FieldDecl=isdoxy36:{{.*}} isdoxy36 IS_DOXYGEN_SINGLE |
| 223 | // CHECK: annotate-comments.cpp:146:7: FieldDecl=isdoxy37:{{.*}} isdoxy37 IS_DOXYGEN_SINGLE |
| 224 | // CHECK: annotate-comments.cpp:147:7: FieldDecl=isdoxy38:{{.*}} isdoxy38 IS_DOXYGEN_SINGLE |
| 225 | // CHECK: annotate-comments.cpp:148:7: FieldDecl=isdoxy39:{{.*}} isdoxy39 IS_DOXYGEN_SINGLE |
| 226 | // CHECK: annotate-comments.cpp:155:6: FunctionDecl=isdoxy40:{{.*}} isdoxy40 IS_DOXYGEN_SINGLE |
| 227 | // CHECK: annotate-comments.cpp:160:5: FunctionDecl=isdoxy41:{{.*}} isdoxy41 IS_DOXYGEN_SINGLE |
| 228 | // CHECK: annotate-comments.cpp:163:7: FieldDecl=isdoxy42:{{.*}} isdoxy42 IS_DOXYGEN_SINGLE |
| 229 | |