Clang Project

clang_source_code/test/Index/comment-custom-block-command.cpp
1// RUN: rm -rf %t
2// RUN: mkdir %t
3
4// Check that custom block commands are defined correctly.
5// RUN: %clang_cc1 -fcomment-block-commands=CustomCommand -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
6// RUN: %clang_cc1 -x c++ -std=c++11 -fcomment-block-commands=CustomCommand -include-pch %t/out.pch -fsyntax-only %s
7
8// RUN: c-index-test -write-pch %t/out.pch -fcomment-block-commands=CustomCommand -x c++ -std=c++11 %s
9// 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
10// RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
11
12// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
13// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch
14
15// Ensure that XML is not invalid
16// WRONG-NOT: CommentXMLInvalid
17
18// RUN: FileCheck %s < %t/out.c-index-direct
19// RUN: FileCheck %s < %t/out.c-index-pch
20
21// XFAIL: vg_leak
22
23#ifndef HEADER
24#define HEADER
25
26/// \CustomCommand Aaa.
27void comment_custom_block_command_1();
28
29// 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>]
30// CHECK-NEXT:  CommentAST=[
31// CHECK-NEXT:    (CXComment_FullComment
32// CHECK-NEXT:       (CXComment_Paragraph IsWhitespace
33// CHECK-NEXT:         (CXComment_Text Text=[ ] IsWhitespace))
34// CHECK-NEXT:       (CXComment_BlockCommand CommandName=[CustomCommand]
35// CHECK-NEXT:         (CXComment_Paragraph
36// CHECK-NEXT:           (CXComment_Text Text=[ Aaa.]))))]
37
38#endif
39
40