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"
78 int Test_HTMLTagComment
;
79 // CHECK: VarDecl{{.*}}Test_HTMLTagComment
80 // CHECK-NEXT: FullComment
81 // CHECK-NEXT: ParagraphComment
82 // CHECK-NEXT: TextComment{{.*}} Text=" "
83 // CHECK-NEXT: HTMLStartTagComment{{.*}} Name="a"
84 // CHECK-NEXT: TextComment{{.*}} Text="Aaa"
85 // CHECK-NEXT: HTMLEndTagComment{{.*}} Name="a"
86 // CHECK-NEXT: TextComment{{.*}} Text=" "
87 // CHECK-NEXT: HTMLStartTagComment{{.*}} Name="br" SelfClosing
96 int Test_VerbatimBlockComment
;
97 // CHECK: VarDecl{{.*}}Test_VerbatimBlockComment
98 // CHECK: VerbatimBlockComment{{.*}} Name="verbatim" CloseName="endverbatim"
99 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" Aaa"
100 // CHECK: VerbatimBlockComment{{.*}} Name="f$" CloseName="f$"
101 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" a "
102 // CHECK: VerbatimBlockComment{{.*}} Name="f(" CloseName="f)"
103 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" b "
104 // CHECK: VerbatimBlockComment{{.*}} Name="f[" CloseName="f]"
105 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" c "
106 // CHECK: VerbatimBlockComment{{.*}} Name="f{" CloseName="f}"
107 // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text="env}{ c "
109 /// \param ... More arguments
111 void Test_TemplatedFunctionVariadic(int arg
, ...);
112 // CHECK: FunctionTemplateDecl{{.*}}Test_TemplatedFunctionVariadic
113 // CHECK: ParamCommandComment{{.*}} [in] implicitly Param="..."
114 // CHECK-NEXT: ParagraphComment
115 // CHECK-NEXT: TextComment{{.*}} Text=" More arguments"