1 // Without serialization: 2 // RUN: %clang_cc1 -Wdocumentation -ast-dump -ast-dump-filter Test %s \ 3 // RUN: | FileCheck -strict-whitespace %s 4 // 5 // With serialization: 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 10 11 /// Aaa 12 int TestLocation; 13 // CHECK: VarDecl{{.*}}TestLocation 14 // CHECK-NEXT: FullComment 0x{{[^ ]*}} <line:[[@LINE-3]]:4, col:7> 15 16 /// 17 int TestIndent; 18 // CHECK: {{^VarDecl.*TestIndent[^()]*$}} 19 // CHECK-NEXT: {{^`-FullComment.*>$}} 20 21 /// Aaa 22 int Test_TextComment; 23 // CHECK: VarDecl{{.*}}Test_TextComment 24 // CHECK-NEXT: FullComment 25 // CHECK-NEXT: ParagraphComment 26 // CHECK-NEXT: TextComment{{.*}} Text=" Aaa" 27 28 /// \brief 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" 34 35 /// \retval 42 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" 41 42 /// \param Aaa xxx 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" 52 53 /// \tparam Aaa xxx 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" 59 60 /// \c Aaa 61 int Test_InlineCommandComment; 62 // CHECK: VarDecl{{.*}}Test_InlineCommandComment 63 // CHECK: InlineCommandComment{{.*}} Name="c" RenderMonospaced Arg[0]="Aaa" 64 65 /// \n Aaa 66 int Test_InlineCommandComment_NoArgs; 67 // CHECK: VarDecl{{.*}}Test_InlineCommandComment_NoArgs 68 // CHECK: InlineCommandComment{{.*}} Name="n" RenderNormal 69 // CHECK-NEXT: TextComment{{.*}} Text=" Aaa" 70 71 /// \anchor Aaa 72 int Test_InlineCommandCommentAnchor; 73 // CHECK: VarDecl{{.*}}Test_InlineCommandComment 74 // CHECK: InlineCommandComment{{.*}} Name="anchor" RenderAnchor Arg[0]="Aaa" 75 76 /// \relates Aaa 77 int Test_InlineCommandCommentRelates; 78 // CHECK: VarDecl{{.*}}Test_InlineCommandCommentRelates 79 // CHECK: InlineCommandComment{{.*}} Name="relates" RenderNormal Arg[0]="Aaa" 80 81 /// <a>Aaa</a> 82 /// <br/> 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 93 94 /// \verbatim 95 /// Aaa 96 /// \endverbatim 97 /// \f$ a \f$ 98 /// \f( b \f) 99 /// \f[ c \f] 100 /// \f{env}{ c \f} 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 " 113 114 /// \param ... More arguments 115 template<typename T> 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" 121