1*67e74705SXin Li// RUN: rm -rf %t 2*67e74705SXin Li// RUN: mkdir %t 3*67e74705SXin Li// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s > %t/out 4*67e74705SXin Li// RUN: FileCheck %s < %t/out 5*67e74705SXin Li// rdar://13067629 6*67e74705SXin Li 7*67e74705SXin Li// Ensure that XML we generate is not invalid. 8*67e74705SXin Li// RUN: FileCheck %s -check-prefix=WRONG < %t/out 9*67e74705SXin Li// WRONG-NOT: CommentXMLInvalid 10*67e74705SXin Li 11*67e74705SXin Li// rdar://12397511 12*67e74705SXin Li 13*67e74705SXin Li/*! 14*67e74705SXin Li \headerfile Device.h <Foundation/Device.h> 15*67e74705SXin Li 16*67e74705SXin Li 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. 17*67e74705SXin Li*/ 18*67e74705SXin Li@interface Device 19*67e74705SXin Li@end 20*67e74705SXin Li// 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 <Foundation/Device.h></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>] 21*67e74705SXin Li// CHECK-NEXT: CommentAST=[ 22*67e74705SXin Li// CHECK-NEXT: (CXComment_FullComment 23*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph IsWhitespace 24*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) 25*67e74705SXin Li// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] 26*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph 27*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ Device.h ]) 28*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[<Foundation]) 29*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[/Device.h>]))) 30*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph 31*67e74705SXin Li// 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.])))] 32*67e74705SXin Li 33*67e74705SXin Li/*! 34*67e74705SXin Li \headerfile Sensor.h "Sensor.h" 35*67e74705SXin Li 36*67e74705SXin Li \brief This is Sensor on the Device. 37*67e74705SXin Li Its purpose is not to Sense Device's heat. 38*67e74705SXin Li*/ 39*67e74705SXin Li 40*67e74705SXin Li@interface Sensor 41*67e74705SXin Li@end 42*67e74705SXin Li// 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 "Sensor.h"</Para></Headerfile><Declaration>@interface Sensor\n@end</Declaration><Abstract><Para> This is Sensor on the Device. Its purpose is not to Sense Device's heat.</Para></Abstract></Other>] 43*67e74705SXin Li// CHECK-NEXT: CommentAST=[ 44*67e74705SXin Li// CHECK-NEXT: (CXComment_FullComment 45*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph IsWhitespace 46*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) 47*67e74705SXin Li// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] 48*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph 49*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ Sensor.h "Sensor.h"]))) 50*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph IsWhitespace 51*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) 52*67e74705SXin Li// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] 53*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph 54*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ This is Sensor on the Device.] HasTrailingNewline) 55*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ Its purpose is not to Sense Device's heat.]))))] 56*67e74705SXin Li 57*67e74705SXin Li/*! 58*67e74705SXin Li \brief Test that headerfile can come after brief. 59*67e74705SXin Li \headerfile VTDevice.h <VTFoundation/VTDevice.h> 60*67e74705SXin Li 61*67e74705SXin Li More property decription goes here. 62*67e74705SXin Li*/ 63*67e74705SXin Li@interface VTDevice : Device 64*67e74705SXin Li@end 65*67e74705SXin Li// 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 <VTFoundation/VTDevice.h></Para></Headerfile><Declaration>@interface VTDevice : Device\n@end</Declaration><Abstract><Para> Test that headerfile can come after brief. </Para></Abstract><Discussion><Para> More property decription goes here.</Para></Discussion></Other>] 66*67e74705SXin Li// CHECK-NEXT: CommentAST=[ 67*67e74705SXin Li// CHECK-NEXT: (CXComment_FullComment 68*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph IsWhitespace 69*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) 70*67e74705SXin Li// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] 71*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph 72*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ Test that headerfile can come after brief.] HasTrailingNewline) 73*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) 74*67e74705SXin Li// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] 75*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph 76*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ VTDevice.h ]) 77*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[<VTFoundation]) 78*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[/VTDevice.h>]))) 79*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph 80*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ More property decription goes here.])))] 81*67e74705SXin Li 82*67e74705SXin Li/*! 83*67e74705SXin Li \headerfile <stdio.h> 84*67e74705SXin Li*/ 85*67e74705SXin Liextern void uses_stdio_h(); 86*67e74705SXin Li// 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> <stdio.h></Para></Headerfile><Declaration>extern void uses_stdio_h()</Declaration></Function>] 87*67e74705SXin Li// CHECK-NEXT: CommentAST=[ 88*67e74705SXin Li// CHECK-NEXT: (CXComment_FullComment 89*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph IsWhitespace 90*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) 91*67e74705SXin Li// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] 92*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph 93*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) 94*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[<stdio]) 95*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[.h>]))))] 96*67e74705SXin Li 97*67e74705SXin Li 98*67e74705SXin Li/*! 99*67e74705SXin Li \headerfile <algorithm> 100*67e74705SXin Li*/ 101*67e74705SXin Liextern void uses_argorithm(); 102*67e74705SXin Li// 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> <algorithm></Para></Headerfile><Declaration>extern void uses_argorithm()</Declaration></Function>] 103*67e74705SXin Li// CHECK-NEXT: CommentAST=[ 104*67e74705SXin Li// CHECK-NEXT: (CXComment_FullComment 105*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph IsWhitespace 106*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) 107*67e74705SXin Li// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] 108*67e74705SXin Li// CHECK-NEXT: (CXComment_Paragraph 109*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) 110*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[<algorithm]) 111*67e74705SXin Li// CHECK-NEXT: (CXComment_Text Text=[>]))))] 112