1 // Without serialization:
2 // RUN: %clang_cc1 -Wdocumentation -ast-dump -ast-dump-filter Test %s \
3 // RUN: | FileCheck -strict-whitespace %s
6 // RUN: %clang_cc1 -Wdocumentation -emit-pch -o %t %s
7 // RUN: %clang_cc1 -x c++ -Wdocumentation -include-pch %t -ast-dump-all -ast-dump-filter Test /dev/null \
8 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
9 // RUN: | FileCheck --strict-whitespace %s
13 // CHECK: VarDecl{{.*}}TestLocation
14 // CHECK-NEXT: FullComment 0x{{[^ ]*}} <line:[[@LINE-3]]:4, col:7>
18 // CHECK: {{^VarDecl.*TestIndent[^()]*$}}
19 // CHECK-NEXT: {{^`-FullComment.*>$}}
23 // CHECK: VarDecl{{.*}}Test_TextComment
24 // CHECK-NEXT: FullComment
25 // CHECK-NEXT: ParagraphComment
26 // CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
29 int Test_BlockCommandComment
;
30 // CHECK: VarDecl{{.*}}Test_BlockCommandComment
31 // CHECK: BlockCommandComment{{.*}} Name="brief"
32 // CHECK-NEXT: ParagraphComment
33 // CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
36 int Test_BlockCommandComment_WithArgs();
37 // CHECK: FunctionDecl{{.*}}Test_BlockCommandComment_WithArgs
38 // CHECK: BlockCommandComment{{.*}} Name="retval" Arg[0]="42"
39 // CHECK-NEXT: ParagraphComment
40 // CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
43 /// \param [in,out] Bbb yyy
44 void Test_ParamCommandComment(int Aaa
, int Bbb
);
45 // CHECK: FunctionDecl{{.*}}Test_ParamCommandComment
46 // CHECK: ParamCommandComment{{.*}} [in] implicitly Param="Aaa" ParamIndex=0
47 // CHECK-NEXT: ParagraphComment
48 // CHECK-NEXT: TextComment{{.*}} Text=" xxx"
49 // CHECK: ParamCommandComment{{.*}} [in,out] explicitly Param="Bbb" ParamIndex=1
50 // CHECK-NEXT: ParagraphComment
51 // CHECK-NEXT: TextComment{{.*}} Text=" yyy"
54 template <typename Aaa
> class Test_TParamCommandComment
;
55 // CHECK: ClassTemplateDecl{{.*}}Test_TParamCommandComment
56 // CHECK: TParamCommandComment{{.*}} Param="Aaa" Position=<0>
57 // CHECK-NEXT: ParagraphComment
58 // CHECK-NEXT: TextComment{{.*}} Text=" xxx"
61 int Test_InlineCommandComment
;
62 // CHECK: VarDecl{{.*}}Test_InlineCommandComment
63 // CHECK: InlineCommandComment{{.*}} Name="c" RenderMonospaced Arg[0]="Aaa"
66 int Test_InlineCommandComment_NoArgs
;
67 // CHECK: VarDecl{{.*}}Test_InlineCommandComment_NoArgs
68 // CHECK: InlineCommandComment{{.*}} Name="n" RenderNormal
69 // CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
72 int Test_InlineCommandCommentAnchor
;
73 // CHECK: VarDecl{{.*}}Test_InlineCommandComment
74 // CHECK: InlineCommandComment{{.*}} Name="anchor" RenderAnchor Arg[0]="Aaa"
77 int Test_InlineCommandCommentRelates
;
78 // CHECK: VarDecl{{.*}}Test_InlineCommandCommentRelates
79 // CHECK: InlineCommandComment{{.*}} Name="relates" RenderNormal Arg[0]="Aaa"
83 int Test_HTMLTagComment
;
84 // CHECK: VarDecl{{.*}}Test_HTMLTagComment
85 // CHECK-NEXT: FullComment
86 // CHECK-NEXT: ParagraphComment
87 // CHECK-NEXT: TextComment{{.*}} Text=" "
88 // CHECK-NEXT: HTMLStartTagComment{{.*}} Name="a"
89 // CHECK-NEXT: TextComment{{.*}} Text="Aaa"
90 // CHECK-NEXT: HTMLEndTagComment{{.*}} Name="a"
91 // CHECK-NEXT: TextComment{{.*}} Text=" "
92 // CHECK-NEXT: HTMLStartTagComment{{.*}} Name="br" SelfClosing
101 int Test_VerbatimBlockComment
;
102 // CHECK: VarDecl{{.*}}Test_VerbatimBlockComment
103 // CHECK: VerbatimBlockComment{{.*}} Name="verbatim" CloseName="endverbatim"
104 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" Aaa"
105 // CHECK: VerbatimBlockComment{{.*}} Name="f$" CloseName="f$"
106 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" a "
107 // CHECK: VerbatimBlockComment{{.*}} Name="f(" CloseName="f)"
108 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" b "
109 // CHECK: VerbatimBlockComment{{.*}} Name="f[" CloseName="f]"
110 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" c "
111 // CHECK: VerbatimBlockComment{{.*}} Name="f{" CloseName="f}"
112 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text="env}{ c "
114 /// \param ... More arguments
116 void Test_TemplatedFunctionVariadic(int arg
, ...);
117 // CHECK: FunctionTemplateDecl{{.*}}Test_TemplatedFunctionVariadic
118 // CHECK: ParamCommandComment{{.*}} [in] implicitly Param="..."
119 // CHECK-NEXT: ParagraphComment
120 // CHECK-NEXT: TextComment{{.*}} Text=" More arguments"