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 /// <a>Aaa</a> 77 /// <br/> 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 88 89 /// \verbatim 90 /// Aaa 91 /// \endverbatim 92 /// \f$ a \f$ 93 /// \f( b \f) 94 /// \f[ c \f] 95 /// \f{env}{ c \f} 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 " 108 109 /// \param ... More arguments 110 template<typename T> 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" 116