Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Index / headerfile-comment-to-html.m
blob32473ea11c1e86439928bf1ff7aa9b7daef5c55c
1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s > %t/out
4 // RUN: FileCheck %s < %t/out
6 // Ensure that XML we generate is not invalid.
7 // RUN: FileCheck %s -check-prefix=WRONG < %t/out
8 // WRONG-NOT: CommentXMLInvalid
10 /*!
11      \headerfile Device.h <Foundation/Device.h>
13       A Device represents a remote or local computer or device with which the Developer Tools can interact.  Each Device supports blah blah blah from doing blah blah blah.
15 @interface Device
16 @end
17 // CHECK: headerfile-comment-to-html.m:[[@LINE-2]]:12: ObjCInterfaceDecl=Device:{{.*}} FullCommentAsXML=[<Other file="{{[^"]+}}headerfile-comment-to-html.m" line="[[@LINE-2]]" column="12"><Name>Device</Name><USR>c:objc(cs)Device</USR><Headerfile><Para> Device.h &lt;Foundation/Device.h&gt;</Para></Headerfile><Declaration>@interface Device\n@end</Declaration><Abstract><Para>      A Device represents a remote or local computer or device with which the Developer Tools can interact.  Each Device supports blah blah blah from doing blah blah blah.</Para></Abstract></Other>]
18 // CHECK-NEXT:  CommentAST=[
19 // CHECK-NEXT:    (CXComment_FullComment
20 // CHECK-NEXT:       (CXComment_Paragraph IsWhitespace
21 // CHECK-NEXT:         (CXComment_Text Text=[     ] IsWhitespace))
22 // CHECK-NEXT:       (CXComment_BlockCommand CommandName=[headerfile]
23 // CHECK-NEXT:         (CXComment_Paragraph
24 // CHECK-NEXT:           (CXComment_Text Text=[ Device.h ])
25 // CHECK-NEXT:           (CXComment_Text Text=[<Foundation])
26 // CHECK-NEXT:           (CXComment_Text Text=[/Device.h>])))
27 // CHECK-NEXT:       (CXComment_Paragraph
28 // CHECK-NEXT:         (CXComment_Text Text=[      A Device represents a remote or local computer or device with which the Developer Tools can interact.  Each Device supports blah blah blah from doing blah blah blah.])))]
30 /*!
31     \headerfile Sensor.h "Sensor.h"
33     \brief This is Sensor on the Device.
34     Its purpose is not to Sense Device's heat.
37 @interface Sensor
38 @end
39 // CHECK: headerfile-comment-to-html.m:[[@LINE-2]]:12: ObjCInterfaceDecl=Sensor:{{.*}} FullCommentAsXML=[<Other file="{{[^"]+}}headerfile-comment-to-html.m" line="[[@LINE-2]]" column="12"><Name>Sensor</Name><USR>c:objc(cs)Sensor</USR><Headerfile><Para> Sensor.h &quot;Sensor.h&quot;</Para></Headerfile><Declaration>@interface Sensor\n@end</Declaration><Abstract><Para> This is Sensor on the Device.    Its purpose is not to Sense Device&apos;s heat.</Para></Abstract></Other>]
40 // CHECK-NEXT:  CommentAST=[
41 // CHECK-NEXT:    (CXComment_FullComment
42 // CHECK-NEXT:       (CXComment_Paragraph IsWhitespace
43 // CHECK-NEXT:         (CXComment_Text Text=[    ] IsWhitespace))
44 // CHECK-NEXT:       (CXComment_BlockCommand CommandName=[headerfile]
45 // CHECK-NEXT:         (CXComment_Paragraph
46 // CHECK-NEXT:           (CXComment_Text Text=[ Sensor.h "Sensor.h"])))
47 // CHECK-NEXT:       (CXComment_Paragraph IsWhitespace
48 // CHECK-NEXT:         (CXComment_Text Text=[    ] IsWhitespace))
49 // CHECK-NEXT:       (CXComment_BlockCommand CommandName=[brief]
50 // CHECK-NEXT:         (CXComment_Paragraph
51 // CHECK-NEXT:           (CXComment_Text Text=[ This is Sensor on the Device.] HasTrailingNewline)
52 // CHECK-NEXT:           (CXComment_Text Text=[    Its purpose is not to Sense Device's heat.]))))]
54 /*!
55     \brief Test that headerfile can come after brief.
56     \headerfile VTDevice.h <VTFoundation/VTDevice.h>
58     More property description goes here.
60 @interface VTDevice : Device
61 @end
62 // CHECK: headerfile-comment-to-html.m:[[@LINE-2]]:12: ObjCInterfaceDecl=VTDevice:{{.*}} FullCommentAsXML=[<Other file="{{[^"]+}}headerfile-comment-to-html.m" line="[[@LINE-2]]" column="12"><Name>VTDevice</Name><USR>c:objc(cs)VTDevice</USR><Headerfile><Para> VTDevice.h &lt;VTFoundation/VTDevice.h&gt;</Para></Headerfile><Declaration>@interface VTDevice : Device\n@end</Declaration><Abstract><Para> Test that headerfile can come after brief.    </Para></Abstract><Discussion><Para>    More property description goes here.</Para></Discussion></Other>]
63 // CHECK-NEXT:  CommentAST=[
64 // CHECK-NEXT:    (CXComment_FullComment
65 // CHECK-NEXT:       (CXComment_Paragraph IsWhitespace
66 // CHECK-NEXT:         (CXComment_Text Text=[    ] IsWhitespace))
67 // CHECK-NEXT:       (CXComment_BlockCommand CommandName=[brief]
68 // CHECK-NEXT:         (CXComment_Paragraph
69 // CHECK-NEXT:           (CXComment_Text Text=[ Test that headerfile can come after brief.] HasTrailingNewline)
70 // CHECK-NEXT:           (CXComment_Text Text=[    ] IsWhitespace)))
71 // CHECK-NEXT:       (CXComment_BlockCommand CommandName=[headerfile]
72 // CHECK-NEXT:         (CXComment_Paragraph
73 // CHECK-NEXT:           (CXComment_Text Text=[ VTDevice.h ])
74 // CHECK-NEXT:           (CXComment_Text Text=[<VTFoundation])
75 // CHECK-NEXT:           (CXComment_Text Text=[/VTDevice.h>])))
76 // CHECK-NEXT:       (CXComment_Paragraph
77 // CHECK-NEXT:         (CXComment_Text Text=[    More property description goes here.])))]
79 /*!
80   \headerfile  <stdio.h>
82 extern void uses_stdio_h();
83 // CHECK: headerfile-comment-to-html.m:[[@LINE-1]]:13: FunctionDecl=uses_stdio_h:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}headerfile-comment-to-html.m" line="[[@LINE-1]]" column="13"><Name>uses_stdio_h</Name><USR>c:@F@uses_stdio_h</USR><Headerfile><Para>  &lt;stdio.h&gt;</Para></Headerfile><Declaration>extern void uses_stdio_h()</Declaration></Function>]
84 // CHECK-NEXT:  CommentAST=[
85 // CHECK-NEXT:    (CXComment_FullComment
86 // CHECK-NEXT:       (CXComment_Paragraph IsWhitespace
87 // CHECK-NEXT:         (CXComment_Text Text=[  ] IsWhitespace))
88 // CHECK-NEXT:       (CXComment_BlockCommand CommandName=[headerfile]
89 // CHECK-NEXT:         (CXComment_Paragraph
90 // CHECK-NEXT:           (CXComment_Text Text=[  ] IsWhitespace)
91 // CHECK-NEXT:           (CXComment_Text Text=[<stdio])
92 // CHECK-NEXT:           (CXComment_Text Text=[.h>]))))]
95 /*!
96   \headerfile  <algorithm>
98 extern void uses_argorithm();
99 // CHECK: headerfile-comment-to-html.m:[[@LINE-1]]:13: FunctionDecl=uses_argorithm:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}headerfile-comment-to-html.m" line="[[@LINE-1]]" column="13"><Name>uses_argorithm</Name><USR>c:@F@uses_argorithm</USR><Headerfile><Para>  &lt;algorithm&gt;</Para></Headerfile><Declaration>extern void uses_argorithm()</Declaration></Function>]
100 // CHECK-NEXT:  CommentAST=[
101 // CHECK-NEXT:    (CXComment_FullComment
102 // CHECK-NEXT:       (CXComment_Paragraph IsWhitespace
103 // CHECK-NEXT:         (CXComment_Text Text=[  ] IsWhitespace))
104 // CHECK-NEXT:       (CXComment_BlockCommand CommandName=[headerfile]
105 // CHECK-NEXT:         (CXComment_Paragraph
106 // CHECK-NEXT:           (CXComment_Text Text=[  ] IsWhitespace)
107 // CHECK-NEXT:           (CXComment_Text Text=[<algorithm])
108 // CHECK-NEXT:           (CXComment_Text Text=[>]))))]