comment-custom-block-command.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // RUN: rm -rf %t
  2. // RUN: mkdir %t
  3. // Check that custom block commands are defined correctly.
  4. // RUN: %clang_cc1 -fcomment-block-commands=CustomCommand -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
  5. // RUN: %clang_cc1 -x c++ -std=c++11 -fcomment-block-commands=CustomCommand -include-pch %t/out.pch -fsyntax-only %s
  6. // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 -fcomment-block-commands=CustomCommand > %t/out.c-index-direct
  7. // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
  8. // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
  9. // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch
  10. // Ensure that XML is not invalid
  11. // WRONG-NOT: CommentXMLInvalid
  12. // RUN: FileCheck %s < %t/out.c-index-direct
  13. // RUN: FileCheck %s < %t/out.c-index-pch
  14. // XFAIL: vg_leak
  15. #ifndef HEADER
  16. #define HEADER
  17. /// \CustomCommand Aaa.
  18. void comment_custom_block_command_1();
  19. // CHECK: comment-custom-block-command.cpp:[[@LINE-2]]:6: FunctionDecl=comment_custom_block_command_1:{{.*}} FullCommentAsHTML=[<p> Aaa.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-custom-block-command.cpp" line="[[@LINE-2]]" column="6"><Name>comment_custom_block_command_1</Name><USR>c:@F@comment_custom_block_command_1#</USR><Declaration>void comment_custom_block_command_1()</Declaration><Discussion><Para> Aaa.</Para></Discussion></Function>]
  20. // CHECK-NEXT: CommentAST=[
  21. // CHECK-NEXT: (CXComment_FullComment
  22. // CHECK-NEXT: (CXComment_Paragraph IsWhitespace
  23. // CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
  24. // CHECK-NEXT: (CXComment_BlockCommand CommandName=[CustomCommand]
  25. // CHECK-NEXT: (CXComment_Paragraph
  26. // CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))]
  27. #endif