ast-dump-comment.cpp 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // RUN: %clang_cc1 -Wdocumentation -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s
  2. /// Aaa
  3. int TestLocation;
  4. // CHECK: VarDecl{{.*}}TestLocation
  5. // CHECK-NEXT: FullComment 0x{{[^ ]*}} <line:[[@LINE-3]]:4, col:7>
  6. ///
  7. int TestIndent;
  8. // CHECK: {{^VarDecl.*TestIndent[^()]*$}}
  9. // CHECK-NEXT: {{^`-FullComment.*>$}}
  10. /// Aaa
  11. int Test_TextComment;
  12. // CHECK: VarDecl{{.*}}Test_TextComment
  13. // CHECK-NEXT: FullComment
  14. // CHECK-NEXT: ParagraphComment
  15. // CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
  16. /// \brief Aaa
  17. int Test_BlockCommandComment;
  18. // CHECK: VarDecl{{.*}}Test_BlockCommandComment
  19. // CHECK: BlockCommandComment{{.*}} Name="brief"
  20. // CHECK-NEXT: ParagraphComment
  21. // CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
  22. /// \param Aaa xxx
  23. /// \param [in,out] Bbb yyy
  24. void Test_ParamCommandComment(int Aaa, int Bbb);
  25. // CHECK: FunctionDecl{{.*}}Test_ParamCommandComment
  26. // CHECK: ParamCommandComment{{.*}} [in] implicitly Param="Aaa" ParamIndex=0
  27. // CHECK-NEXT: ParagraphComment
  28. // CHECK-NEXT: TextComment{{.*}} Text=" xxx"
  29. // CHECK: ParamCommandComment{{.*}} [in,out] explicitly Param="Bbb" ParamIndex=1
  30. // CHECK-NEXT: ParagraphComment
  31. // CHECK-NEXT: TextComment{{.*}} Text=" yyy"
  32. /// \tparam Aaa xxx
  33. template <typename Aaa> class Test_TParamCommandComment;
  34. // CHECK: ClassTemplateDecl{{.*}}Test_TParamCommandComment
  35. // CHECK: TParamCommandComment{{.*}} Param="Aaa" Position=<0>
  36. // CHECK-NEXT: ParagraphComment
  37. // CHECK-NEXT: TextComment{{.*}} Text=" xxx"
  38. /// \c Aaa
  39. int Test_InlineCommandComment;
  40. // CHECK: VarDecl{{.*}}Test_InlineCommandComment
  41. // CHECK: InlineCommandComment{{.*}} Name="c" RenderMonospaced Arg[0]="Aaa"
  42. /// <a>Aaa</a>
  43. /// <br/>
  44. int Test_HTMLTagComment;
  45. // CHECK: VarDecl{{.*}}Test_HTMLTagComment
  46. // CHECK-NEXT: FullComment
  47. // CHECK-NEXT: ParagraphComment
  48. // CHECK-NEXT: TextComment{{.*}} Text=" "
  49. // CHECK-NEXT: HTMLStartTagComment{{.*}} Name="a"
  50. // CHECK-NEXT: TextComment{{.*}} Text="Aaa"
  51. // CHECK-NEXT: HTMLEndTagComment{{.*}} Name="a"
  52. // CHECK-NEXT: TextComment{{.*}} Text=" "
  53. // CHECK-NEXT: HTMLStartTagComment{{.*}} Name="br" SelfClosing
  54. /// \verbatim
  55. /// Aaa
  56. /// \endverbatim
  57. int Test_VerbatimBlockComment;
  58. // CHECK: VarDecl{{.*}}Test_VerbatimBlockComment
  59. // CHECK: VerbatimBlockComment{{.*}} Name="verbatim" CloseName="endverbatim"
  60. // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" Aaa"
  61. /// \param ... More arguments
  62. template<typename T>
  63. void Test_TemplatedFunctionVariadic(int arg, ...);
  64. // CHECK: FunctionTemplateDecl{{.*}}Test_TemplatedFunctionVariadic
  65. // CHECK: ParamCommandComment{{.*}} [in] implicitly Param="..."
  66. // CHECK-NEXT: ParagraphComment
  67. // CHECK-NEXT: TextComment{{.*}} Text=" More arguments"