blob: b5dbe2e317d8c7a3352e7e433faecaa40c86608f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
// Without serialization:
// RUN: %clang_cc1 -Wdocumentation -ast-dump -ast-dump-filter Test %s \
// RUN: | FileCheck -strict-whitespace %s
//
// With serialization:
// RUN: %clang_cc1 -Wdocumentation -emit-pch -o %t %s
// RUN: %clang_cc1 -x c++ -Wdocumentation -include-pch %t -ast-dump-all -ast-dump-filter Test /dev/null \
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
// RUN: | FileCheck --strict-whitespace %s
/// Aaa
int TestLocation;
// CHECK: VarDecl{{.*}}TestLocation
// CHECK-NEXT: FullComment 0x{{[^ ]*}} <line:[[@LINE-3]]:4, col:7>
///
int TestIndent;
// CHECK: {{^VarDecl.*TestIndent[^()]*$}}
// CHECK-NEXT: {{^`-FullComment.*>$}}
/// Aaa
int Test_TextComment;
// CHECK: VarDecl{{.*}}Test_TextComment
// CHECK-NEXT: FullComment
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
/// \brief Aaa
int Test_BlockCommandComment;
// CHECK: VarDecl{{.*}}Test_BlockCommandComment
// CHECK: BlockCommandComment{{.*}} Name="brief"
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
/// \retval 42 Aaa
int Test_BlockCommandComment_WithArgs();
// CHECK: FunctionDecl{{.*}}Test_BlockCommandComment_WithArgs
// CHECK: BlockCommandComment{{.*}} Name="retval" Arg[0]="42"
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
/// \param Aaa xxx
/// \param [in,out] Bbb yyy
void Test_ParamCommandComment(int Aaa, int Bbb);
// CHECK: FunctionDecl{{.*}}Test_ParamCommandComment
// CHECK: ParamCommandComment{{.*}} [in] implicitly Param="Aaa" ParamIndex=0
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" xxx"
// CHECK: ParamCommandComment{{.*}} [in,out] explicitly Param="Bbb" ParamIndex=1
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" yyy"
/// \tparam Aaa xxx
template <typename Aaa> class Test_TParamCommandComment;
// CHECK: ClassTemplateDecl{{.*}}Test_TParamCommandComment
// CHECK: TParamCommandComment{{.*}} Param="Aaa" Position=<0>
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" xxx"
/// \c Aaa
int Test_InlineCommandComment;
// CHECK: VarDecl{{.*}}Test_InlineCommandComment
// CHECK: InlineCommandComment{{.*}} Name="c" RenderMonospaced Arg[0]="Aaa"
/// \n Aaa
int Test_InlineCommandComment_NoArgs;
// CHECK: VarDecl{{.*}}Test_InlineCommandComment_NoArgs
// CHECK: InlineCommandComment{{.*}} Name="n" RenderNormal
// CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
/// \anchor Aaa
int Test_InlineCommandCommentAnchor;
// CHECK: VarDecl{{.*}}Test_InlineCommandComment
// CHECK: InlineCommandComment{{.*}} Name="anchor" RenderAnchor Arg[0]="Aaa"
/// \relates Aaa
int Test_InlineCommandCommentRelates;
// CHECK: VarDecl{{.*}}Test_InlineCommandCommentRelates
// CHECK: InlineCommandComment{{.*}} Name="relates" RenderNormal Arg[0]="Aaa"
/// <a>Aaa</a>
/// <br/>
int Test_HTMLTagComment;
// CHECK: VarDecl{{.*}}Test_HTMLTagComment
// CHECK-NEXT: FullComment
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" "
// CHECK-NEXT: HTMLStartTagComment{{.*}} Name="a"
// CHECK-NEXT: TextComment{{.*}} Text="Aaa"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="a"
// CHECK-NEXT: TextComment{{.*}} Text=" "
// CHECK-NEXT: HTMLStartTagComment{{.*}} Name="br" SelfClosing
/// <a
/// href="foo"
/// >Aaa</a>b
int Test_HTMLTagMultilineBCPL;
// CHECK: VarDecl{{.*}}Test_HTMLTagMultilineBCPL
// CHECK-NEXT: FullComment
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" "
// CHECK-NEXT: HTMLStartTagComment{{.*}} Name="a" Attrs: "href="foo"
// CHECK-NEXT: TextComment{{.*}} Text="Aaa"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="a"
// CHECK-NEXT: TextComment{{.*}} Text="b"
/// \verbatim
/// Aaa
/// \endverbatim
/// \f$ a \f$
/// \f( b \f)
/// \f[ c \f]
/// \f{env}{ c \f}
int Test_VerbatimBlockComment;
// CHECK: VarDecl{{.*}}Test_VerbatimBlockComment
// CHECK: VerbatimBlockComment{{.*}} Name="verbatim" CloseName="endverbatim"
// CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" Aaa"
// CHECK: VerbatimBlockComment{{.*}} Name="f$" CloseName="f$"
// CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" a "
// CHECK: VerbatimBlockComment{{.*}} Name="f(" CloseName="f)"
// CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" b "
// CHECK: VerbatimBlockComment{{.*}} Name="f[" CloseName="f]"
// CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" c "
// CHECK: VerbatimBlockComment{{.*}} Name="f{" CloseName="f}"
// CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text="env}{ c "
/// \param ... More arguments
template<typename T>
void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK: FunctionTemplateDecl{{.*}}Test_TemplatedFunctionVariadic
// CHECK: ParamCommandComment{{.*}} [in] implicitly Param="..."
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" More arguments"
/// \param[out] Aaa <summary>Short summary</summary>
int Test_HTMLSummaryTag(int Aaa);
// CHECK: FunctionDecl{{.*}}Test_HTMLSummaryTag
// CHECK: ParamCommandComment{{.*}} [out] explicitly Param="Aaa"
// CHECK-NEXT: ParagraphComment
// CHECK: HTMLStartTagComment{{.*}} Name="summary"
// CHECK-NEXT: TextComment{{.*}} Text="Short summary"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="summary"
/// \thread_safe test for underscore in special command
int Test_UnderscoreInSpecialCommand;
// CHECK: VarDecl{{.*}}Test_UnderscoreInSpecialCommand 'int'
// CHECK: InlineCommandComment{{.*}} Name="thread_safe" RenderNormal
// CHECK-NEXT: TextComment{{.*}} Text=" test for underscore in special command"
/// <details>
/// <summary>
/// Summary
/// </summary>
/// <p>Details</p>
/// </details>
///
/// Some <mark>highlighting</mark>
///
/// <figure>
/// <img src="pic.jpg">
/// <figcaption>Figure 1</figcaption>
/// </figure>
int Test_AdditionalHTMLTags(int Aaa);
// CHECK: FunctionDecl{{.*}}Test_AdditionalHTMLTags 'int (int)'
// CHECK: HTMLStartTagComment{{.*}} Name="details"
// CHECK: HTMLStartTagComment{{.*}} Name="summary"
// CHECK-NEXT: TextComment{{.*}} Text=" Summary"
// CHECK: HTMLEndTagComment{{.*}} Name="summary"
// CHECK: HTMLStartTagComment{{.*}} Name="p"
// CHECK-NEXT: TextComment{{.*}} Text="Details"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="p"
// CHECK: HTMLEndTagComment{{.*}} Name="details"
// CHECK: HTMLStartTagComment{{.*}} Name="mark"
// CHECK-NEXT: TextComment{{.*}} Text="highlighting"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="mark"
// CHECK: HTMLStartTagComment{{.*}} Name="figure"
// CHECK: HTMLStartTagComment{{.*}} Name="img" Attrs: "src="pic.jpg"
// CHECK: HTMLStartTagComment{{.*}} Name="figcaption"
// CHECK-NEXT: TextComment{{.*}} Text="Figure 1"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="figcaption"
// CHECK: HTMLEndTagComment{{.*}} Name="figure"
|