diff options
Diffstat (limited to 'test/Index')
75 files changed, 2659 insertions, 880 deletions
diff --git a/test/Index/IBOutletCollection.m b/test/Index/IBOutletCollection.m index a95df86..1b5d62c 100644 --- a/test/Index/IBOutletCollection.m +++ b/test/Index/IBOutletCollection.m @@ -10,9 +10,11 @@ // RUN: c-index-test -test-annotate-tokens=%s:4:1:5:1 %s | FileCheck -check-prefix=CHECK-TOK %s // CHECK-TOK: Identifier: "IBOutletCollection" [4:3 - 4:21] macro expansion=IBOutletCollection:1:9 -// CHECK-TOK: Punctuation: "(" [4:21 - 4:22] ObjCInterfaceDecl=Test:3:12 +// FIXME: The following token should belong to the macro expansion cursor. +// CHECK-TOK: Punctuation: "(" [4:21 - 4:22] attribute(iboutletcollection)= [IBOutletCollection=ObjCInterface] // CHECK-TOK: Identifier: "Test" [4:22 - 4:26] ObjCClassRef=Test:3:12 -// CHECK-TOK: Punctuation: ")" [4:26 - 4:27] ObjCIvarDecl=anOutletCollection:4:34 (Definition) +// FIXME: The following token should belong to the macro expansion cursor. +// CHECK-TOK: Punctuation: ")" [4:26 - 4:27] // CHECK-TOK: Identifier: "Test" [4:28 - 4:32] ObjCClassRef=Test:3:12 // CHECK-TOK: Punctuation: "*" [4:33 - 4:34] ObjCIvarDecl=anOutletCollection:4:34 (Definition) // CHECK-TOK: Identifier: "anOutletCollection" [4:34 - 4:52] ObjCIvarDecl=anOutletCollection:4:34 (Definition) diff --git a/test/Index/Inputs/CommentXML/invalid-para-kind-01.xml b/test/Index/Inputs/CommentXML/invalid-para-kind-01.xml new file mode 100644 index 0000000..9b82042 --- /dev/null +++ b/test/Index/Inputs/CommentXML/invalid-para-kind-01.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<Function> +<Name>aaa</Name> +<Abstract><Para>Aaa.</Para></Abstract> +<Discussion> + <Para kind="">Bbb</Para> +</Discussion> +</Function> + diff --git a/test/Index/Inputs/CommentXML/invalid-para-kind-02.xml b/test/Index/Inputs/CommentXML/invalid-para-kind-02.xml new file mode 100644 index 0000000..a1a2900 --- /dev/null +++ b/test/Index/Inputs/CommentXML/invalid-para-kind-02.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<Function> +<Name>aaa</Name> +<Abstract><Para>Aaa.</Para></Abstract> +<Discussion> + <Para kind="zzz">Bbb</Para> +</Discussion> +</Function> + diff --git a/test/Index/Inputs/CommentXML/valid-para-kind-01.xml b/test/Index/Inputs/CommentXML/valid-para-kind-01.xml new file mode 100644 index 0000000..71fe277 --- /dev/null +++ b/test/Index/Inputs/CommentXML/valid-para-kind-01.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<Function> +<Name>aaa</Name> +<Abstract><Para>Aaa.</Para></Abstract> +<Discussion> + <Para>Bbb</Para> + <Para kind="attention">Bbb</Para> + <Para kind="author">Bbb</Para> + <Para kind="authors">Bbb</Para> + <Para kind="bug">Bbb</Para> + <Para kind="copyright">Bbb</Para> + <Para kind="date">Bbb</Para> + <Para kind="invariant">Bbb</Para> + <Para kind="note">Bbb</Para> + <Para kind="post">Bbb</Para> + <Para kind="pre">Bbb</Para> + <Para kind="remark">Bbb</Para> + <Para kind="remarks">Bbb</Para> + <Para kind="sa">Bbb</Para> + <Para kind="see">Bbb</Para> + <Para kind="since">Bbb</Para> + <Para kind="todo">Bbb</Para> + <Para kind="version">Bbb</Para> + <Para kind="warning">Bbb</Para> +</Discussion> +</Function> + diff --git a/test/Index/annotate-comments-availability-attrs.cpp b/test/Index/annotate-comments-availability-attrs.cpp index 777881d..74a57b9 100644 --- a/test/Index/annotate-comments-availability-attrs.cpp +++ b/test/Index/annotate-comments-availability-attrs.cpp @@ -13,32 +13,31 @@ void attr_availability_1() __attribute__((availability(macosx,obsoleted=10.0,introduced=8.0,deprecated=9.0, message="use availability_test in <foo.h>"))) __attribute__((availability(ios,unavailable, message="not for iOS"))); +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-3]]" column="6"><Name>attr_availability_1</Name><USR>c:@F@attr_availability_1#</USR><Declaration>void attr_availability_1()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Availability distribution="iOS"><DeprecationSummary>not for iOS</DeprecationSummary><Unavailable/></Availability><Availability distribution="OS X"><IntroducedInVersion>8.0</IntroducedInVersion><DeprecatedInVersion>9.0</DeprecatedInVersion><RemovedAfterVersion>10.0</RemovedAfterVersion><DeprecationSummary>use availability_test in <foo.h></DeprecationSummary></Availability></Function>] + /// Aaa. void attr_availability_2() __attribute__((availability(macosx,obsoleted=10.0.1,introduced=8.0.1,deprecated=9.0.1))); +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-2]]" column="6"><Name>attr_availability_2</Name><USR>c:@F@attr_availability_2#</USR><Declaration>void attr_availability_2()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Availability distribution="OS X"><IntroducedInVersion>8.0.1</IntroducedInVersion><DeprecatedInVersion>9.0.1</DeprecatedInVersion><RemovedAfterVersion>10.0.1</RemovedAfterVersion></Availability></Function>] + /// Aaa. void attr_deprecated_1() __attribute__((deprecated)); +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-2]]" column="6"><Name>attr_deprecated_1</Name><USR>c:@F@attr_deprecated_1#</USR><Declaration>void attr_deprecated_1()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Deprecated/></Function>] + /// Aaa. void attr_deprecated_2() __attribute__((deprecated("message 1 <foo.h>"))); +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-2]]" column="6"><Name>attr_deprecated_2</Name><USR>c:@F@attr_deprecated_2#</USR><Declaration>void attr_deprecated_2()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Deprecated>message 1 <foo.h></Deprecated></Function>] + + /// Aaa. void attr_unavailable_1() __attribute__((unavailable)); +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-2]]" column="6"><Name>attr_unavailable_1</Name><USR>c:@F@attr_unavailable_1#</USR><Declaration>void attr_unavailable_1()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Unavailable/></Function>] + /// Aaa. void attr_unavailable_2() __attribute__((unavailable("message 2 <foo.h>"))); -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="13" column="6"><Name>attr_availability_1</Name><USR>c:@F@attr_availability_1#</USR><Declaration>void attr_availability_1()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Availability distribution="iOS"><DeprecationSummary>not for iOS</DeprecationSummary><Unavailable/></Availability><Availability distribution="OS X"><IntroducedInVersion>8.0</IntroducedInVersion><DeprecatedInVersion>9.0</DeprecatedInVersion><RemovedAfterVersion>10.0</RemovedAfterVersion><DeprecationSummary>use availability_test in <foo.h></DeprecationSummary></Availability></Function>] - - -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="17" column="6"><Name>attr_availability_2</Name><USR>c:@F@attr_availability_2#</USR><Declaration>void attr_availability_2()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Availability distribution="OS X"><IntroducedInVersion>8.0.1</IntroducedInVersion><DeprecatedInVersion>9.0.1</DeprecatedInVersion><RemovedAfterVersion>10.0.1</RemovedAfterVersion></Availability></Function>] - -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="20" column="6"><Name>attr_deprecated_1</Name><USR>c:@F@attr_deprecated_1#</USR><Declaration>void attr_deprecated_1()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Deprecated/></Function>] - -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="23" column="6"><Name>attr_deprecated_2</Name><USR>c:@F@attr_deprecated_2#</USR><Declaration>void attr_deprecated_2()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Deprecated>message 1 <foo.h></Deprecated></Function>] - - -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="26" column="6"><Name>attr_unavailable_1</Name><USR>c:@F@attr_unavailable_1#</USR><Declaration>void attr_unavailable_1()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Unavailable/></Function>] - +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-2]]" column="6"><Name>attr_unavailable_2</Name><USR>c:@F@attr_unavailable_2#</USR><Declaration>void attr_unavailable_2()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Unavailable>message 2 <foo.h></Unavailable></Function>] -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="29" column="6"><Name>attr_unavailable_2</Name><USR>c:@F@attr_unavailable_2#</USR><Declaration>void attr_unavailable_2()</Declaration><Abstract><Para> Aaa.</Para></Abstract><Unavailable>message 2 <foo.h></Unavailable></Function>] diff --git a/test/Index/annotate-comments-property-accessor.m b/test/Index/annotate-comments-property-accessor.m new file mode 100644 index 0000000..2bd1d01 --- /dev/null +++ b/test/Index/annotate-comments-property-accessor.m @@ -0,0 +1,62 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s > %t/out +// RUN: FileCheck %s < %t/out +// rdar://12378879 + +// Ensure that XML we generate is not invalid. +// RUN: FileCheck %s -check-prefix=WRONG < %t/out +// WRONG-NOT: CommentXMLInvalid + +@interface AppDelegate +/** + \brief This is ReadonlyProperty +*/ +@property (readonly, getter = ReadonlyGetter) int MyProperty; +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-1]]" column="51"><Name>MyProperty</Name><USR>c:objc(cs)AppDelegate(py)MyProperty</USR><Declaration>- (int)ReadonlyGetter;</Declaration><Abstract><Para> This is ReadonlyProperty</Para></Abstract></Function>] + +/** + \brief This is GeneralProperty +*/ +@property int GeneralProperty; +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-1]]" column="15"><Name>GeneralProperty</Name><USR>c:objc(cs)AppDelegate(py)GeneralProperty</USR><Declaration>- (int)GeneralProperty;</Declaration><Abstract><Para> This is GeneralProperty</Para></Abstract></Function>] +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-2]]" column="15"><Name>GeneralProperty</Name><USR>c:objc(cs)AppDelegate(py)GeneralProperty</USR><Declaration>- (void)setGeneralProperty:(int)GeneralProperty;</Declaration><Abstract><Para> This is GeneralProperty</Para></Abstract></Function>] + +/** + \brief This is PropertyInPrimaryClass +*/ +@property (copy, nonatomic) id PropertyInPrimaryClass; +- (void) setThisRecord : (id)arg; +- (id) Record; +@end +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-4]]" column="32"><Name>PropertyInPrimaryClass</Name><USR>c:objc(cs)AppDelegate(py)PropertyInPrimaryClass</USR><Declaration>- (id)PropertyInPrimaryClass;</Declaration><Abstract><Para> This is PropertyInPrimaryClass</Para></Abstract></Function>] +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-5]]" column="32"><Name>PropertyInPrimaryClass</Name><USR>c:objc(cs)AppDelegate(py)PropertyInPrimaryClass</USR><Declaration>- (void)setPropertyInPrimaryClass:(id)PropertyInPrimaryClass;</Declaration><Abstract><Para> This is PropertyInPrimaryClass</Para></Abstract></Function>] + +@interface AppDelegate() +- (id) GetterInClassExtension; +/** + \brief This is Record +*/ +@property (copy, setter = setThisRecord:) id Record; +@end +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-6]]" column="1"><Name>PropertyInClassExtension</Name><USR>c:objc(cs)AppDelegate(py)PropertyInClassExtension</USR><Declaration>- (id)GetterInClassExtension;</Declaration><Abstract><Para> This is PropertyInClassExtension</Para></Abstract></Function>] + +@interface AppDelegate() +/** + \brief This is PropertyInClassExtension +*/ +@property (copy, getter = GetterInClassExtension) id PropertyInClassExtension; + +- (id) PropertyInPrimaryClass; +@end +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-4]]" column="54"><Name>PropertyInClassExtension</Name><USR>c:objc(cs)AppDelegate(py)PropertyInClassExtension</USR><Declaration>- (id)GetterInClassExtension;</Declaration><Abstract><Para> This is PropertyInClassExtension</Para></Abstract></Function>] +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments-property-accessor.m" line="[[@LINE-5]]" column="54"><Name>PropertyInClassExtension</Name><USR>c:objc(cs)AppDelegate(py)PropertyInClassExtension</USR><Declaration>- (void)setPropertyInClassExtension:(id)PropertyInClassExtension;</Declaration><Abstract><Para> This is PropertyInClassExtension</Para></Abstract></Function>] + +@implementation AppDelegate +- (id) PropertyInPrimaryClass { return 0; } +@end + + + + + diff --git a/test/Index/annotate-comments-typedef.m b/test/Index/annotate-comments-typedef.m new file mode 100644 index 0000000..b23e535 --- /dev/null +++ b/test/Index/annotate-comments-typedef.m @@ -0,0 +1,49 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s > %t/out +// RUN: FileCheck %s < %t/out +// rdar://13067629 + +// Ensure that XML we generate is not invalid. +// RUN: FileCheck %s -check-prefix=WRONG < %t/out +// WRONG-NOT: CommentXMLInvalid + +/** Documentation for NSUInteger */ +typedef unsigned int NSUInteger; + +/** Documentation for MyEnum */ +typedef enum : NSUInteger { + MyEnumFoo, /**< value Foo */ + MyEnumBar, /**< value Bar */ + MyEnumBaz, /**< value Baz */ +} MyEnum; +// CHECK: TypedefDecl=MyEnum:[[@LINE-1]]:3 (Definition) FullCommentAsHTML=[<p class="para-brief"> Documentation for MyEnum </p>] FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-1]]" column="3"><Name><anonymous></Name><USR>c:@EA@MyEnum</USR><Declaration>typedef enum MyEnum MyEnum</Declaration><Abstract><Para> Documentation for MyEnum </Para></Abstract></Typedef>] + + +/** Documentation for E */ +enum E { + E_MyEnumFoo, /**< value Foo */ + E_MyEnumBar, /**< value Bar */ + E_MyEnumBaz, /**< value Baz */ +}; +typedef enum E E_T; +// CHECK: EnumDecl=E:[[@LINE-6]]:6 (Definition) {{.*}} BriefComment=[Documentation for E] FullCommentAsHTML=[<p class="para-brief"> Documentation for E </p>] FullCommentAsXML=[<Enum file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-6]]" column="6"><Name>E</Name><USR>c:@E@E</USR><Declaration>enum E{{( : int)?}} {}</Declaration><Abstract><Para> Documentation for E </Para></Abstract></Enum>] +// CHECK: TypedefDecl=E_T:[[@LINE-2]]:16 (Definition) FullCommentAsHTML=[<p class="para-brief"> Documentation for E </p>] FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-2]]" column="16"><Name>E</Name><USR>c:@E@E</USR><Declaration>typedef enum E E_T</Declaration><Abstract><Para> Documentation for E </Para></Abstract></Typedef>] + + +/** Comment about Foo */ +typedef struct { + int iii; + } Foo; +// CHECK: TypedefDecl=Foo:[[@LINE-1]]:11 (Definition) FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-1]]" column="11"><Name><anonymous></Name><USR>c:@SA@Foo</USR><Declaration>typedef struct Foo Foo</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Typedef>] +// CHECK: StructDecl=:[[@LINE-4]]:9 (Definition) {{.*}} BriefComment=[Comment about Foo] FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Class file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-4]]" column="9"><Name><anonymous></Name><USR>c:@SA@Foo</USR><Declaration>struct {}</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Class>] + + +struct Foo1 { + int iii; +}; +/** About Foo1T */ +typedef struct Foo1 Foo1T; +// FIXME: we don't attach this comment to 'struct Foo1' +// CHECK: TypedefDecl=Foo1T:[[@LINE-2]]:21 (Definition) {{.*}} FullCommentAsHTML=[<p class="para-brief"> About Foo1T </p>] FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-2]]" column="21"><Name>Foo1T</Name><USR>c:annotate-comments-typedef.m@{{[0-9]+}}@T@Foo1T</USR><Declaration>typedef struct Foo1 Foo1T</Declaration><Abstract><Para> About Foo1T </Para></Abstract></Typedef>] + diff --git a/test/Index/annotate-comments.cpp b/test/Index/annotate-comments.cpp index b8b8e6c..2a0b635 100644 --- a/test/Index/annotate-comments.cpp +++ b/test/Index/annotate-comments.cpp @@ -247,239 +247,12 @@ void isdoxy52(int); */ void isdoxy53(int); -/// Aaa. -void comment_to_html_conversion_1(); - -/// \brief Aaa. -void comment_to_html_conversion_2(); - -/// \short Aaa. -void comment_to_html_conversion_3(); - -/// Aaa. -/// -/// \brief Bbb. -void comment_to_html_conversion_4(); - -/// Aaa. -/// -/// \brief Bbb. -/// -/// Ccc. -void comment_to_html_conversion_5(); - -/// \brief Aaa. -/// \brief Bbb. -void comment_to_html_conversion_6(); - -/// Aaa. -/// -/// \return Bbb. -void comment_to_html_conversion_7(); - -/// Aaa. -/// -/// \returns Bbb. -void comment_to_html_conversion_8(); - -/// Aaa. -/// -/// \result Bbb. -void comment_to_html_conversion_9(); - -/// \returns Aaa. -/// \returns Bbb. -void comment_to_html_conversion_10(); - -/// Aaa. -/// -/// Bbb. -/// -/// \returns Ccc. -void comment_to_html_conversion_11(); - -/// \param -void comment_to_html_conversion_12(int x1); - -/// \param x1 Aaa. -void comment_to_html_conversion_13(int x1); - -/// \param zzz Aaa. -void comment_to_html_conversion_14(int x1); - -/// \param x2 Bbb. -/// \param x1 Aaa. -void comment_to_html_conversion_15(int x1, int x2); - -/// \param x2 Bbb. -/// \param zzz Aaa. -/// \param x1 Aaa. -void comment_to_html_conversion_16(int x1, int x2); - -/// \tparam -/// \param aaa Blah blah -template<typename T> -void comment_to_html_conversion_17(T aaa); - -/// \tparam T -/// \param aaa Blah blah -template<typename T> -void comment_to_html_conversion_18(T aaa); - -/// \tparam T2 Bbb -/// \tparam T1 Aaa -template<typename T1, typename T2> -void comment_to_html_conversion_19(T1 aaa, T2 bbb); - -/// \tparam T2 Bbb -/// \tparam U Zzz -/// \tparam V Ccc -/// \tparam T1 Aaa -template<typename T1, typename T2, int V> -void comment_to_html_conversion_20(T1 aaa, T2 bbb); - -/// \tparam TTT Ddd -/// \tparam C Ccc -/// \tparam T Aaa -/// \tparam TT Bbb -template<template<template<typename T> class TT, class C> class TTT> -void comment_to_html_conversion_21(); - -/// \brief Aaa. -/// -/// Bbb. -/// -/// \param x2 Ddd. -/// \param x1 Ccc. -/// \returns Eee. -void comment_to_html_conversion_22(int x1, int x2); - -/// <br><a href="http://example.com/">Aaa</a> -void comment_to_html_conversion_23(); - -/// \verbatim -/// <a href="http://example.com/">Aaa</a> -/// <a href='http://example.com/'>Aaa</a> -/// \endverbatim -void comment_to_html_conversion_24(); - -/// \function foo -/// \class foo -/// \method foo -/// \interface foo -/// Blah blah. -void comment_to_html_conversion_25(); - -/// \unknown -void comment_to_html_conversion_26(); - -/// \b Aaa -void comment_to_html_conversion_27(); - -/// \c Aaa \p Bbb -void comment_to_html_conversion_28(); - -/// \a Aaa \e Bbb \em Ccc -void comment_to_html_conversion_29(); - -/// \a 1<2 \e 3<4 \em 5<6 \param 7<8 aaa \tparam 9<10 bbb -void comment_to_html_conversion_30(); - -/// \\ \@ \& \$ \# \< \> \% \" \. \:: -void comment_to_html_conversion_31(); - -/// & < > " -void comment_to_html_conversion_32(); - -/// <em>0<i</em> -void comment_to_html_conversion_33(); - -/// Aaa. -class comment_to_xml_conversion_01 { - /// \param aaa Blah blah. - comment_to_xml_conversion_01(int aaa); - - /// Aaa. - ~comment_to_xml_conversion_01(); - - /// \param aaa Blah blah. - int comment_to_xml_conversion_02(int aaa); - - /// \param aaa Blah blah. - static int comment_to_xml_conversion_03(int aaa); - - /// Aaa. - int comment_to_xml_conversion_04; - - /// Aaa. - static int comment_to_xml_conversion_05; - - /// \param aaa Blah blah. - void operator()(int aaa); - - /// Aaa. - operator bool(); - - /// Aaa. - typedef int comment_to_xml_conversion_06; - - /// Aaa. - using comment_to_xml_conversion_07 = int; - - template<typename T, typename U> - class comment_to_xml_conversion_08 { }; - - /// Aaa. - template<typename T> - using comment_to_xml_conversion_09 = comment_to_xml_conversion_08<T, int>; -}; - -/// Aaa. -template<typename T, typename U> -void comment_to_xml_conversion_10(T aaa, U bbb); - -/// Aaa. -template<> -void comment_to_xml_conversion_10(int aaa, int bbb); - -/// Aaa. -template<typename T, typename U> -class comment_to_xml_conversion_11 { }; - -/// Aaa. -template<typename T> -class comment_to_xml_conversion_11<T, int> { }; - -/// Aaa. -template<> -class comment_to_xml_conversion_11<int, int> { }; - -/// Aaa. -int comment_to_xml_conversion_12; - -/// Aaa. -namespace comment_to_xml_conversion_13 { - /// Aaa. - namespace comment_to_xml_conversion_14 { - } -} - -/// Aaa. -enum comment_to_xml_conversion_15 { - /// Aaa. - comment_to_xml_conversion_16 -}; - -/// Aaa. -enum class comment_to_xml_conversion_17 { - /// Aaa. - comment_to_xml_conversion_18 -}; - #endif // RUN: rm -rf %t // RUN: mkdir %t + +// Check that we serialize comment source locations properly. // RUN: %clang_cc1 -x c++ -std=c++11 -emit-pch -o %t/out.pch %s // RUN: %clang_cc1 -x c++ -std=c++11 -include-pch %t/out.pch -fsyntax-only %s @@ -509,6 +282,11 @@ enum class comment_to_xml_conversion_17 { // RUN: FileCheck %s < %t/out.c-index-direct // RUN: FileCheck %s < %t/out.c-index-pch +// These CHECK lines are not located near the code on purpose. This test +// checks that documentation comments are attached to declarations correctly. +// Adding a non-documentation comment with CHECK line between every two +// documentation comments will only test a single code path. +// // CHECK: annotate-comments.cpp:16:6: FunctionDecl=isdoxy4:{{.*}} isdoxy4 IS_DOXYGEN_SINGLE // CHECK: annotate-comments.cpp:20:6: FunctionDecl=isdoxy5:{{.*}} isdoxy5 IS_DOXYGEN_SINGLE // CHECK: annotate-comments.cpp:25:6: FunctionDecl=isdoxy6:{{.*}} isdoxy6 IS_DOXYGEN_SINGLE @@ -550,414 +328,3 @@ enum class comment_to_xml_conversion_17 { // CHECK: annotate-comments.cpp:231:6: FunctionDecl=isdoxy51:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START] // CHECK: annotate-comments.cpp:241:6: FunctionDecl=isdoxy52:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START Bbb.] -// CHECK: annotate-comments.cpp:251:6: FunctionDecl=comment_to_html_conversion_1:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="251" column="6"><Name>comment_to_html_conversion_1</Name><USR>c:@F@comment_to_html_conversion_1#</USR><Declaration>void comment_to_html_conversion_1()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])))] -// CHECK: annotate-comments.cpp:254:6: FunctionDecl=comment_to_html_conversion_2:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="254" column="6"><Name>comment_to_html_conversion_2</Name><USR>c:@F@comment_to_html_conversion_2#</USR><Declaration>void comment_to_html_conversion_2()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] -// CHECK: annotate-comments.cpp:257:6: FunctionDecl=comment_to_html_conversion_3:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="257" column="6"><Name>comment_to_html_conversion_3</Name><USR>c:@F@comment_to_html_conversion_3#</USR><Declaration>void comment_to_html_conversion_3()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[short] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] -// CHECK: annotate-comments.cpp:262:6: FunctionDecl=comment_to_html_conversion_4:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Bbb.</p><p> Aaa.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="262" column="6"><Name>comment_to_html_conversion_4</Name><USR>c:@F@comment_to_html_conversion_4#</USR><Declaration>void comment_to_html_conversion_4()</Declaration><Abstract><Para> Bbb.</Para></Abstract><Discussion><Para> Aaa.</Para></Discussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] -// CHECK: annotate-comments.cpp:269:6: FunctionDecl=comment_to_html_conversion_5:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Bbb.</p><p> Aaa.</p><p> Ccc.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="269" column="6"><Name>comment_to_html_conversion_5</Name><USR>c:@F@comment_to_html_conversion_5#</USR><Declaration>void comment_to_html_conversion_5()</Declaration><Abstract><Para> Bbb.</Para></Abstract><Discussion><Para> Aaa.</Para><Para> Ccc.</Para></Discussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))) -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Ccc.])))] -// CHECK: annotate-comments.cpp:273:6: FunctionDecl=comment_to_html_conversion_6:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa. </p><p class="para-brief"> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="273" column="6"><Name>comment_to_html_conversion_6</Name><USR>c:@F@comment_to_html_conversion_6#</USR><Declaration>void comment_to_html_conversion_6()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Discussion><Para> Bbb.</Para></Discussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] -// CHECK: annotate-comments.cpp:278:6: FunctionDecl=comment_to_html_conversion_7:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="278" column="6"><Name>comment_to_html_conversion_7</Name><USR>c:@F@comment_to_html_conversion_7#</USR><Declaration>void comment_to_html_conversion_7()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[return] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] -// CHECK: annotate-comments.cpp:283:6: FunctionDecl=comment_to_html_conversion_8:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="283" column="6"><Name>comment_to_html_conversion_8</Name><USR>c:@F@comment_to_html_conversion_8#</USR><Declaration>void comment_to_html_conversion_8()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] -// CHECK: annotate-comments.cpp:288:6: FunctionDecl=comment_to_html_conversion_9:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="288" column="6"><Name>comment_to_html_conversion_9</Name><USR>c:@F@comment_to_html_conversion_9#</USR><Declaration>void comment_to_html_conversion_9()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[result] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] -// CHECK: annotate-comments.cpp:292:6: FunctionDecl=comment_to_html_conversion_10:{{.*}} FullCommentAsHTML=[<p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p><p class="para-returns"><span class="word-returns">Returns</span> Aaa. </p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="292" column="6"><Name>comment_to_html_conversion_10</Name><USR>c:@F@comment_to_html_conversion_10#</USR><Declaration>void comment_to_html_conversion_10()</Declaration><ResultDiscussion><Para> Aaa. </Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] -// CHECK: annotate-comments.cpp:299:6: FunctionDecl=comment_to_html_conversion_11:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p> Bbb.</p><p class="para-returns"><span class="word-returns">Returns</span> Ccc.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="299" column="6"><Name>comment_to_html_conversion_11</Name><USR>c:@F@comment_to_html_conversion_11#</USR><Declaration>void comment_to_html_conversion_11()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Ccc.</Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.])) -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Ccc.]))))] -// CHECK: annotate-comments.cpp:302:6: FunctionDecl=comment_to_html_conversion_12:{{.*}} FullCommentAsHTML=[] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="302" column="6"><Name>comment_to_html_conversion_12</Name><USR>c:@F@comment_to_html_conversion_12#I#</USR><Declaration>void comment_to_html_conversion_12(int x1)</Declaration></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[] ParamIndex=Invalid -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace)))] -// CHECK: annotate-comments.cpp:305:6: FunctionDecl=comment_to_html_conversion_13:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Aaa.</dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="305" column="6"><Name>comment_to_html_conversion_13</Name><USR>c:@F@comment_to_html_conversion_13#I#</USR><Declaration>void comment_to_html_conversion_13(int x1)</Declaration><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa.</Para></Discussion></Parameter></Parameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x1] ParamIndex=0 -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] -// CHECK: annotate-comments.cpp:308:6: FunctionDecl=comment_to_html_conversion_14:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-invalid">zzz</dt><dd class="param-descr-index-invalid"> Aaa.</dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="308" column="6"><Name>comment_to_html_conversion_14</Name><USR>c:@F@comment_to_html_conversion_14#I#</USR><Declaration>void comment_to_html_conversion_14(int x1)</Declaration><Parameters><Parameter><Name>zzz</Name><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa.</Para></Discussion></Parameter></Parameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[zzz] ParamIndex=Invalid -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] -// CHECK: annotate-comments.cpp:312:6: FunctionDecl=comment_to_html_conversion_15:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Aaa.</dd><dt class="param-name-index-1">x2</dt><dd class="param-descr-index-1"> Bbb. </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="312" column="6"><Name>comment_to_html_conversion_15</Name><USR>c:@F@comment_to_html_conversion_15#I#I#</USR><Declaration>void comment_to_html_conversion_15(int x1, int x2)</Declaration><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa.</Para></Discussion></Parameter><Parameter><Name>x2</Name><Index>1</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Bbb. </Para></Discussion></Parameter></Parameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x2] ParamIndex=1 -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x1] ParamIndex=0 -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] -// CHECK: annotate-comments.cpp:317:6: FunctionDecl=comment_to_html_conversion_16:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Aaa.</dd><dt class="param-name-index-1">x2</dt><dd class="param-descr-index-1"> Bbb. </dd><dt class="param-name-index-invalid">zzz</dt><dd class="param-descr-index-invalid"> Aaa. </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="317" column="6"><Name>comment_to_html_conversion_16</Name><USR>c:@F@comment_to_html_conversion_16#I#I#</USR><Declaration>void comment_to_html_conversion_16(int x1, int x2)</Declaration><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa.</Para></Discussion></Parameter><Parameter><Name>x2</Name><Index>1</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Bbb. </Para></Discussion></Parameter><Parameter><Name>zzz</Name><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa. </Para></Discussion></Parameter></Parameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x2] ParamIndex=1 -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[zzz] ParamIndex=Invalid -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x1] ParamIndex=0 -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] -// CHECK: annotate-comments.cpp:322:6: FunctionTemplate=comment_to_html_conversion_17:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">aaa</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}annotate-comments.cpp" line="322" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_17#t0.0#</USR><Declaration>template <typename T> void comment_to_html_conversion_17(T aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[] ParamPosition=Invalid -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[aaa] ParamIndex=0 -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Blah blah]))))] -// CHECK: annotate-comments.cpp:327:6: FunctionTemplate=comment_to_html_conversion_18:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">aaa</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}annotate-comments.cpp" line="327" column="6"><Name>comment_to_html_conversion_18</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_18#t0.0#</USR><Declaration>template <typename T> void comment_to_html_conversion_18(T aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T] ParamPosition={0} -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[aaa] ParamIndex=0 -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Blah blah]))))] -// CHECK: annotate-comments.cpp:332:6: FunctionTemplate=comment_to_html_conversion_19:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">T1</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">T2</dt><dd class="tparam-descr-index-1"> Bbb </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}annotate-comments.cpp" line="332" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@>2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><Declaration>template <typename T1, typename T2> void comment_to_html_conversion_19(T1 aaa, T2 bbb)</Declaration><TemplateParameters><Parameter><Name>T1</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>T2</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T2] ParamPosition={1} -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T1] ParamPosition={0} -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa]))))] -// CHECK: annotate-comments.cpp:339:6: FunctionTemplate=comment_to_html_conversion_20:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">T1</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">T2</dt><dd class="tparam-descr-index-1"> Bbb </dd><dt class="tparam-name-index-2">V</dt><dd class="tparam-descr-index-2"> Ccc </dd><dt class="tparam-name-index-invalid">U</dt><dd class="tparam-descr-index-invalid"> Zzz </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}annotate-comments.cpp" line="339" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@>3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><Declaration>template <typename T1, typename T2, int V> void comment_to_html_conversion_20(T1 aaa, T2 bbb)</Declaration><TemplateParameters><Parameter><Name>T1</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>T2</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>V</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>U</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T2] ParamPosition={1} -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[U] ParamPosition=Invalid -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Zzz] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[V] ParamPosition={2} -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Ccc] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T1] ParamPosition={0} -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa]))))] -// CHECK: annotate-comments.cpp:346:6: FunctionTemplate=comment_to_html_conversion_21:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">TTT</dt><dd class="tparam-descr-index-0"> Ddd </dd><dt class="tparam-name-index-other">C</dt><dd class="tparam-descr-index-other"> Ccc </dd><dt class="tparam-name-index-other">T</dt><dd class="tparam-descr-index-other"> Aaa </dd><dt class="tparam-name-index-other">TT</dt><dd class="tparam-descr-index-other"> Bbb</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}annotate-comments.cpp" line="346" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@>1#t>2#t>1#T#Tcomment_to_html_conversion_21#</USR><Declaration>template <template <template <typename T> class TT, class C> class TTT> void comment_to_html_conversion_21()</Declaration><TemplateParameters><Parameter><Name>TTT</Name><Index>0</Index><Discussion><Para> Ddd </Para></Discussion></Parameter><Parameter><Name>C</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>T</Name><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>TT</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[TTT] ParamPosition={0} -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Ddd] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[C] ParamPosition={0, 1} -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Ccc] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T] ParamPosition={0, 0, 0} -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[TT] ParamPosition={0, 0} -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb]))))] -// CHECK: annotate-comments.cpp:355:6: FunctionDecl=comment_to_html_conversion_22:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p> Bbb.</p><dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Ccc. </dd><dt class="param-name-index-1">x2</dt><dd class="param-descr-index-1"> Ddd. </dd></dl><p class="para-returns"><span class="word-returns">Returns</span> Eee.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="355" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@F@comment_to_html_conversion_22#I#I#</USR><Declaration>void comment_to_html_conversion_22(int x1, int x2)</Declaration><Abstract><Para> Aaa.</Para></Abstract><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Ccc. </Para></Discussion></Parameter><Parameter><Name>x2</Name><Index>1</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Ddd. </Para></Discussion></Parameter></Parameters><ResultDiscussion><Para> Eee.</Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))) -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Bbb.])) -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x2] ParamIndex=1 -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Ddd.] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x1] ParamIndex=0 -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Ccc.] HasTrailingNewline) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) -// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ Eee.]))))] -// CHECK: annotate-comments.cpp:358:6: FunctionDecl=comment_to_html_conversion_23:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <br><a href="http://example.com/">Aaa</a></p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="358" column="6"><Name>comment_to_html_conversion_23</Name><USR>c:@F@comment_to_html_conversion_23#</USR><Declaration>void comment_to_html_conversion_23()</Declaration><Abstract><Para> <rawHTML><![CDATA[<br>]]></rawHTML><rawHTML><![CDATA[<a href="http://example.com/">]]></rawHTML>Aaa<rawHTML></a></rawHTML></Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_HTMLStartTag Name=[br]) -// CHECK-NEXT: (CXComment_HTMLStartTag Name=[a] Attrs: href=http://example.com/) -// CHECK-NEXT: (CXComment_Text Text=[Aaa]) -// CHECK-NEXT: (CXComment_HTMLEndTag Name=[a])))] -// CHECK: annotate-comments.cpp:364:6: FunctionDecl=comment_to_html_conversion_24:{{.*}} FullCommentAsHTML=[<pre> <a href="http://example.com/">Aaa</a>\n <a href='http://example.com/'>Aaa</a></pre>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="364" column="6"><Name>comment_to_html_conversion_24</Name><USR>c:@F@comment_to_html_conversion_24#</USR><Declaration>void comment_to_html_conversion_24()</Declaration><Discussion><Verbatim xml:space="preserve" kind="verbatim"> <a href="http://example.com/">Aaa</a>\n <a href='http://example.com/'>Aaa</a></Verbatim></Discussion></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph IsWhitespace -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_VerbatimBlockCommand CommandName=[verbatim] -// CHECK-NEXT: (CXComment_VerbatimBlockLine Text=[ <a href="http://example.com/">Aaa</a>]) -// CHECK-NEXT: (CXComment_VerbatimBlockLine Text=[ <a href='http://example.com/'>Aaa</a>])))] -// CHECK: annotate-comments.cpp:371:6: FunctionDecl=comment_to_html_conversion_25:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Blah blah.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="371" column="6"><Name>comment_to_html_conversion_25</Name><USR>c:@F@comment_to_html_conversion_25#</USR><Declaration>void comment_to_html_conversion_25()</Declaration><Abstract><Para> Blah blah.</Para></Abstract></Function>] -// CHECK: CommentAST=[ -// CHECK: (CXComment_FullComment -// CHECK: (CXComment_Paragraph IsWhitespace -// CHECK: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK: (CXComment_VerbatimLine Text=[ foo]) -// CHECK: (CXComment_Paragraph IsWhitespace -// CHECK: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK: (CXComment_VerbatimLine Text=[ foo]) -// CHECK: (CXComment_Paragraph IsWhitespace -// CHECK: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK: (CXComment_VerbatimLine Text=[ foo]) -// CHECK: (CXComment_Paragraph IsWhitespace -// CHECK: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK: (CXComment_VerbatimLine Text=[ foo]) -// CHECK: (CXComment_Paragraph -// CHECK: (CXComment_Text Text=[ Blah blah.])))] -// CHECK: annotate-comments.cpp:374:6: FunctionDecl=comment_to_html_conversion_26:{{.*}} FullCommentAsHTML=[<p class="para-brief"> </p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="374" column="6"><Name>comment_to_html_conversion_26</Name><USR>c:@F@comment_to_html_conversion_26#</USR><Declaration>void comment_to_html_conversion_26()</Declaration><Abstract><Para> </Para></Abstract></Function>] -// CHECK: CommentAST=[ -// CHECK: (CXComment_FullComment -// CHECK: (CXComment_Paragraph -// CHECK: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK: (CXComment_InlineCommand CommandName=[unknown] RenderNormal)))] -// CHECK: annotate-comments.cpp:377:6: FunctionDecl=comment_to_html_conversion_27:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <b>Aaa</b></p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="377" column="6"><Name>comment_to_html_conversion_27</Name><USR>c:@F@comment_to_html_conversion_27#</USR><Declaration>void comment_to_html_conversion_27()</Declaration><Abstract><Para> <bold>Aaa</bold></Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_InlineCommand CommandName=[b] RenderBold Arg[0]=Aaa)))] -// CHECK: annotate-comments.cpp:380:6: FunctionDecl=comment_to_html_conversion_28:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <tt>Aaa</tt> <tt>Bbb</tt></p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="380" column="6"><Name>comment_to_html_conversion_28</Name><USR>c:@F@comment_to_html_conversion_28#</USR><Declaration>void comment_to_html_conversion_28()</Declaration><Abstract><Para> <monospaced>Aaa</monospaced> <monospaced>Bbb</monospaced></Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_InlineCommand CommandName=[c] RenderMonospaced Arg[0]=Aaa) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_InlineCommand CommandName=[p] RenderMonospaced Arg[0]=Bbb)))] -// CHECK: annotate-comments.cpp:383:6: FunctionDecl=comment_to_html_conversion_29:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>Aaa</em> <em>Bbb</em> <em>Ccc</em></p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="383" column="6"><Name>comment_to_html_conversion_29</Name><USR>c:@F@comment_to_html_conversion_29#</USR><Declaration>void comment_to_html_conversion_29()</Declaration><Abstract><Para> <emphasized>Aaa</emphasized> <emphasized>Bbb</emphasized> <emphasized>Ccc</emphasized></Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_InlineCommand CommandName=[a] RenderEmphasized Arg[0]=Aaa) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_InlineCommand CommandName=[e] RenderEmphasized Arg[0]=Bbb) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_InlineCommand CommandName=[em] RenderEmphasized Arg[0]=Ccc)))] -// CHECK: annotate-comments.cpp:386:6: FunctionDecl=comment_to_html_conversion_30:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>1<2</em> <em>3<4</em> <em>5<6</em> </p><dl><dt class="tparam-name-index-invalid">9<10</dt><dd class="tparam-descr-index-invalid"> bbb</dd></dl><dl><dt class="param-name-index-invalid">7<8</dt><dd class="param-descr-index-invalid"> aaa </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="386" column="6"><Name>comment_to_html_conversion_30</Name><USR>c:@F@comment_to_html_conversion_30#</USR><Declaration>void comment_to_html_conversion_30()</Declaration><Abstract><Para> <emphasized>1<2</emphasized> <emphasized>3<4</emphasized> <emphasized>5<6</emphasized> </Para></Abstract><TemplateParameters><Parameter><Name>9<10</Name><Discussion><Para> bbb</Para></Discussion></Parameter></TemplateParameters><Parameters><Parameter><Name>7<8</Name><Direction isExplicit="0">in</Direction><Discussion><Para> aaa </Para></Discussion></Parameter></Parameters></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_InlineCommand CommandName=[a] RenderEmphasized Arg[0]=1<2) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_InlineCommand CommandName=[e] RenderEmphasized Arg[0]=3<4) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_InlineCommand CommandName=[em] RenderEmphasized Arg[0]=5<6) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) -// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[7<8] ParamIndex=Invalid -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ aaa ]))) -// CHECK-NEXT: (CXComment_TParamCommand ParamName=[9<10] ParamPosition=Invalid -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ bbb]))))] -// CHECK: annotate-comments.cpp:389:6: FunctionDecl=comment_to_html_conversion_31:{{.*}} FullCommentAsHTML=[<p class="para-brief"> \ @ & $ # < > % " . ::</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="389" column="6"><Name>comment_to_html_conversion_31</Name><USR>c:@F@comment_to_html_conversion_31#</USR><Declaration>void comment_to_html_conversion_31()</Declaration><Abstract><Para> \ @ & $ # < > % " . ::</Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[\]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[@]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[&]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[$]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[#]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[<]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[>]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[%]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=["]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[.]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[::])))] -// CHECK: annotate-comments.cpp:392:6: FunctionDecl=comment_to_html_conversion_32:{{.*}} FullCommentAsHTML=[<p class="para-brief"> & < > "</p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="392" column="6"><Name>comment_to_html_conversion_32</Name><USR>c:@F@comment_to_html_conversion_32#</USR><Declaration>void comment_to_html_conversion_32()</Declaration><Abstract><Para> & < > "</Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[&]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[<]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=[>]) -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_Text Text=["])))] -// CHECK: annotate-comments.cpp:395:6: FunctionDecl=comment_to_html_conversion_33:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>0<i</em></p>] FullCommentAsXML=[<Function file="{{[^"]+}}annotate-comments.cpp" line="395" column="6"><Name>comment_to_html_conversion_33</Name><USR>c:@F@comment_to_html_conversion_33#</USR><Declaration>void comment_to_html_conversion_33()</Declaration><Abstract><Para> <rawHTML><![CDATA[<em>]]></rawHTML>0<i<rawHTML></em></rawHTML></Para></Abstract></Function>] -// CHECK-NEXT: CommentAST=[ -// CHECK-NEXT: (CXComment_FullComment -// CHECK-NEXT: (CXComment_Paragraph -// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) -// CHECK-NEXT: (CXComment_HTMLStartTag Name=[em]) -// CHECK-NEXT: (CXComment_Text Text=[0]) -// CHECK-NEXT: (CXComment_Text Text=[<]) -// CHECK-NEXT: (CXComment_Text Text=[i]) -// CHECK-NEXT: (CXComment_HTMLEndTag Name=[em])))] - -// CHECK: annotate-comments.cpp:398:7: ClassDecl=comment_to_xml_conversion_01:{{.*}} FullCommentAsXML=[<Class file="{{[^"]+}}annotate-comments.cpp" line="398" column="7"><Name>comment_to_xml_conversion_01</Name><USR>c:@C@comment_to_xml_conversion_01</USR><Declaration>class comment_to_xml_conversion_01 {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Class>] -// CHECK: annotate-comments.cpp:400:3: CXXConstructor=comment_to_xml_conversion_01:{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments.cpp" line="400" column="3"><Name>comment_to_xml_conversion_01</Name><USR>c:@C@comment_to_xml_conversion_01@F@comment_to_xml_conversion_01#I#</USR><Declaration></Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah.</Para></Discussion></Parameter></Parameters></Function>] -// CHECK: annotate-comments.cpp:403:3: CXXDestructor=~comment_to_xml_conversion_01:{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments.cpp" line="403" column="3"><Name>~comment_to_xml_conversion_01</Name><USR>c:@C@comment_to_xml_conversion_01@F@~comment_to_xml_conversion_01#</USR><Declaration>void ~comment_to_xml_conversion_01()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] -// CHECK: annotate-comments.cpp:406:7: CXXMethod=comment_to_xml_conversion_02:{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments.cpp" line="406" column="7"><Name>comment_to_xml_conversion_02</Name><USR>c:@C@comment_to_xml_conversion_01@F@comment_to_xml_conversion_02#I#</USR><Declaration>int comment_to_xml_conversion_02(int aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah.</Para></Discussion></Parameter></Parameters></Function>] -// CHECK: annotate-comments.cpp:409:14: CXXMethod=comment_to_xml_conversion_03:{{.*}} FullCommentAsXML=[<Function isClassMethod="1" file="{{[^"]+}}annotate-comments.cpp" line="409" column="14"><Name>comment_to_xml_conversion_03</Name><USR>c:@C@comment_to_xml_conversion_01@F@comment_to_xml_conversion_03#I#S</USR><Declaration>static int comment_to_xml_conversion_03(int aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah.</Para></Discussion></Parameter></Parameters></Function>] -// CHECK: annotate-comments.cpp:412:7: FieldDecl=comment_to_xml_conversion_04:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}annotate-comments.cpp" line="412" column="7"><Name>comment_to_xml_conversion_04</Name><USR>c:@C@comment_to_xml_conversion_01@FI@comment_to_xml_conversion_04</USR><Declaration>int comment_to_xml_conversion_04</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] -// CHECK: annotate-comments.cpp:415:14: VarDecl=comment_to_xml_conversion_05:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}annotate-comments.cpp" line="415" column="14"><Name>comment_to_xml_conversion_05</Name><USR>c:@C@comment_to_xml_conversion_01@comment_to_xml_conversion_05</USR><Declaration>static int comment_to_xml_conversion_05</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] -// CHECK: annotate-comments.cpp:418:8: CXXMethod=operator():{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments.cpp" line="418" column="8"><Name>operator()</Name><USR>c:@C@comment_to_xml_conversion_01@F@operator()#I#</USR><Declaration>void operator()(int aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah.</Para></Discussion></Parameter></Parameters></Function>] -// CHECK: annotate-comments.cpp:421:3: CXXConversion=operator _Bool:{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}annotate-comments.cpp" line="421" column="3"><Name>operator _Bool</Name><USR>c:@C@comment_to_xml_conversion_01@F@operator _Bool#</USR><Declaration>bool operator _Bool()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] -// CHECK: annotate-comments.cpp:424:15: TypedefDecl=comment_to_xml_conversion_06:{{.*}} FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments.cpp" line="424" column="15"><Name>comment_to_xml_conversion_06</Name><USR>c:annotate-comments.cpp@8505@C@comment_to_xml_conversion_01@T@comment_to_xml_conversion_06</USR><Declaration>typedef int comment_to_xml_conversion_06</Declaration><Abstract><Para> Aaa.</Para></Abstract></Typedef>] -// CHECK: annotate-comments.cpp:427:9: TypeAliasDecl=comment_to_xml_conversion_07:{{.*}} FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments.cpp" line="427" column="9"><Name>comment_to_xml_conversion_07</Name><USR>c:@C@comment_to_xml_conversion_01@comment_to_xml_conversion_07</USR><Declaration>using comment_to_xml_conversion_07 = int</Declaration><Abstract><Para> Aaa.</Para></Abstract></Typedef>] -// CHECK: annotate-comments.cpp:434:3: UnexposedDecl=comment_to_xml_conversion_09:{{.*}} FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments.cpp" line="434" column="3"><Name>comment_to_xml_conversion_09</Name><USR>c:@C@comment_to_xml_conversion_01@comment_to_xml_conversion_09</USR><Declaration>template <typename T> using comment_to_xml_conversion_09 = comment_to_xml_conversion_08<T, int></Declaration><Abstract><Para> Aaa.</Para></Abstract></Typedef>] -// CHECK: annotate-comments.cpp:439:6: FunctionTemplate=comment_to_xml_conversion_10:{{.*}} FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}annotate-comments.cpp" line="439" column="6"><Name>comment_to_xml_conversion_10</Name><USR>c:@FT@>2#T#Tcomment_to_xml_conversion_10#t0.0#t0.1#</USR><Declaration>template <typename T = int, typename U = int> void comment_to_xml_conversion_10(int aaa, int bbb)template <typename T, typename U> void comment_to_xml_conversion_10(T aaa, U bbb)</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] -// CHECK: annotate-comments.cpp:443:6: FunctionDecl=comment_to_xml_conversion_10:{{.*}} FullCommentAsXML=[<Function templateKind="specialization" file="{{[^"]+}}annotate-comments.cpp" line="443" column="6"><Name>comment_to_xml_conversion_10</Name><USR>c:@F@comment_to_xml_conversion_10<#I#I>#I#I#</USR><Declaration>void comment_to_xml_conversion_10(int aaa, int bbb)</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] -// CHECK: annotate-comments.cpp:447:7: ClassTemplate=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[<Class templateKind="template" file="{{[^"]+}}annotate-comments.cpp" line="447" column="7"><Name>comment_to_xml_conversion_11</Name><USR>c:@CT>2#T#T@comment_to_xml_conversion_11</USR><Declaration>template <typename T = int, typename U = int> class comment_to_xml_conversion_11 {\n}\ntemplate <typename T, typename U> class comment_to_xml_conversion_11 {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Class>] -// CHECK: annotate-comments.cpp:451:7: ClassTemplatePartialSpecialization=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[<Class templateKind="partialSpecialization" file="{{[^"]+}}annotate-comments.cpp" line="451" column="7"><Name>comment_to_xml_conversion_11</Name><USR>c:@CP>1#T@comment_to_xml_conversion_11>#t0.0#I</USR><Declaration>class comment_to_xml_conversion_11 {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Class>] -// CHECK: annotate-comments.cpp:455:7: ClassDecl=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[<Class templateKind="specialization" file="{{[^"]+}}annotate-comments.cpp" line="455" column="7"><Name>comment_to_xml_conversion_11</Name><USR>c:@C@comment_to_xml_conversion_11>#I#I</USR><Declaration>class comment_to_xml_conversion_11 {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Class>] -// CHECK: annotate-comments.cpp:458:5: VarDecl=comment_to_xml_conversion_12:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}annotate-comments.cpp" line="458" column="5"><Name>comment_to_xml_conversion_12</Name><USR>c:@comment_to_xml_conversion_12</USR><Declaration>int comment_to_xml_conversion_12</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] -// CHECK: annotate-comments.cpp:461:11: Namespace=comment_to_xml_conversion_13:{{.*}} FullCommentAsXML=[<Namespace file="{{[^"]+}}annotate-comments.cpp" line="461" column="11"><Name>comment_to_xml_conversion_13</Name><USR>c:@N@comment_to_xml_conversion_13</USR><Declaration>namespace comment_to_xml_conversion_13 {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Namespace>] -// CHECK: annotate-comments.cpp:463:13: Namespace=comment_to_xml_conversion_14:{{.*}} FullCommentAsXML=[<Namespace file="{{[^"]+}}annotate-comments.cpp" line="463" column="13"><Name>comment_to_xml_conversion_14</Name><USR>c:@N@comment_to_xml_conversion_13@N@comment_to_xml_conversion_14</USR><Declaration>namespace comment_to_xml_conversion_14 {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Namespace>] -// CHECK: annotate-comments.cpp:468:6: EnumDecl=comment_to_xml_conversion_15:{{.*}} FullCommentAsXML=[<Enum file="{{[^"]+}}annotate-comments.cpp" line="468" column="6"><Name>comment_to_xml_conversion_15</Name><USR>c:@E@comment_to_xml_conversion_15</USR><Declaration>enum comment_to_xml_conversion_15{{( : int)?}} {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Enum>] -// CHECK: annotate-comments.cpp:470:3: EnumConstantDecl=comment_to_xml_conversion_16:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}annotate-comments.cpp" line="470" column="3"><Name>comment_to_xml_conversion_16</Name><USR>c:@E@comment_to_xml_conversion_15@comment_to_xml_conversion_16</USR><Declaration>comment_to_xml_conversion_16</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] -// CHECK: annotate-comments.cpp:474:12: EnumDecl=comment_to_xml_conversion_17:{{.*}} FullCommentAsXML=[<Enum file="{{[^"]+}}annotate-comments.cpp" line="474" column="12"><Name>comment_to_xml_conversion_17</Name><USR>c:@E@comment_to_xml_conversion_17</USR><Declaration>enum class comment_to_xml_conversion_17 : int {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Enum>] -// CHECK: annotate-comments.cpp:476:3: EnumConstantDecl=comment_to_xml_conversion_18:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}annotate-comments.cpp" line="476" column="3"><Name>comment_to_xml_conversion_18</Name><USR>c:@E@comment_to_xml_conversion_17@comment_to_xml_conversion_18</USR><Declaration>comment_to_xml_conversion_18</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] diff --git a/test/Index/annotate-context-sensitive.cpp b/test/Index/annotate-context-sensitive.cpp index 34e67a2..57e6783 100644 --- a/test/Index/annotate-context-sensitive.cpp +++ b/test/Index/annotate-context-sensitive.cpp @@ -27,7 +27,7 @@ struct Derived2 : Base2 { // CHECK-OVERRIDE-FINAL: Keyword: "public" [6:23 - 6:29] C++ base class specifier=class Base:1:7 [access=public isVirtual=false] // CHECK-OVERRIDE-FINAL: Identifier: "Base" [6:30 - 6:34] TypeRef=class Base:1:7 // CHECK-OVERRIDE-FINAL: Punctuation: "{" [6:35 - 6:36] ClassDecl=Derived:6:7 (Definition) -// CHECK-OVERRIDE-FINAL: Keyword: "virtual" [7:3 - 7:10] ClassDecl=Derived:6:7 (Definition) +// CHECK-OVERRIDE-FINAL: Keyword: "virtual" [7:3 - 7:10] CXXMethod=f:7:16 (virtual) [Overrides @3:16] // CHECK-OVERRIDE-FINAL: Keyword: "void" [7:11 - 7:15] CXXMethod=f:7:16 (virtual) [Overrides @3:16] // CHECK-OVERRIDE-FINAL: Identifier: "f" [7:16 - 7:17] CXXMethod=f:7:16 (virtual) [Overrides @3:16] // CHECK-OVERRIDE-FINAL: Punctuation: "(" [7:17 - 7:18] CXXMethod=f:7:16 (virtual) [Overrides @3:16] diff --git a/test/Index/annotate-deep-statements.cpp b/test/Index/annotate-deep-statements.cpp index 32a48b7..79f2d39 100644 --- a/test/Index/annotate-deep-statements.cpp +++ b/test/Index/annotate-deep-statements.cpp @@ -3,6 +3,9 @@ // rdar://11979525 // Check that we don't get stack overflow trying to annotate an extremely deep AST. +// AddressSanitizer increases stack usage. +// XFAIL: asan + struct S { S &operator()(); }; diff --git a/test/Index/annotate-module.m b/test/Index/annotate-module.m index 3423f2b..33ca3f8 100644 --- a/test/Index/annotate-module.m +++ b/test/Index/annotate-module.m @@ -1,10 +1,10 @@ #include <DependsOnModule/DependsOnModule.h> -@__experimental_modules_import DependsOnModule; +@import DependsOnModule; int glob; // RUN: rm -rf %t.cache -// RUN: c-index-test -test-annotate-tokens=%s:2:1:5:1 %s -fmodule-cache-path %t.cache -fmodules -F %S/../Modules/Inputs \ +// RUN: c-index-test -test-annotate-tokens=%s:2:1:5:1 %s -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \ // RUN: | FileCheck %s // CHECK: Punctuation: "#" [2:1 - 2:2] inclusion directive=[[INC_DIR:DependsOnModule[/\\]DependsOnModule\.h \(.*/Modules/Inputs/DependsOnModule\.framework[/\\]Headers[/\\]DependsOnModule.h\)]] @@ -17,14 +17,14 @@ int glob; // CHECK-NEXT: Identifier: "h" [2:43 - 2:44] inclusion directive=[[INC_DIR]] // CHECK-NEXT: Punctuation: ">" [2:44 - 2:45] inclusion directive=[[INC_DIR]] // CHECK-NEXT: Punctuation: "@" [3:1 - 3:2] ModuleImport=DependsOnModule:3:1 -// CHECK-NEXT: Keyword: "__experimental_modules_import" [3:2 - 3:31] ModuleImport=DependsOnModule:3:1 -// CHECK-NEXT: Identifier: "DependsOnModule" [3:32 - 3:47] ModuleImport=DependsOnModule:3:1 -// CHECK-NEXT: Punctuation: ";" [3:47 - 3:48] +// CHECK-NEXT: Keyword: "import" [3:2 - 3:8] ModuleImport=DependsOnModule:3:1 +// CHECK-NEXT: Identifier: "DependsOnModule" [3:9 - 3:24] ModuleImport=DependsOnModule:3:1 +// CHECK-NEXT: Punctuation: ";" [3:24 - 3:25] // CHECK-NEXT: Keyword: "int" [4:1 - 4:4] VarDecl=glob:4:5 // CHECK-NEXT: Identifier: "glob" [4:5 - 4:9] VarDecl=glob:4:5 // CHECK-NEXT: Punctuation: ";" [4:9 - 4:10] -// RUN: c-index-test -test-annotate-tokens=%S/../Modules/Inputs/Module.framework/Headers/Sub.h:1:1:3:1 %s -fmodule-cache-path %t.cache -fmodules -F %S/../Modules/Inputs \ +// RUN: c-index-test -test-annotate-tokens=%S/../Modules/Inputs/Module.framework/Headers/Sub.h:1:1:3:1 %s -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \ // RUN: | FileCheck %s -check-prefix=CHECK-MOD // CHECK-MOD: Punctuation: "#" [1:1 - 1:2] inclusion directive=[[INC_DIR:Module[/\\]Sub2\.h \(.*/Modules/Inputs/Module\.framework[/\\]Headers[/\\]Sub2.h\)]] diff --git a/test/Index/annotate-nested-name-specifier.cpp b/test/Index/annotate-nested-name-specifier.cpp index c4f60e3..eddd215 100644 --- a/test/Index/annotate-nested-name-specifier.cpp +++ b/test/Index/annotate-nested-name-specifier.cpp @@ -340,7 +340,7 @@ struct X9 : X8 { // CHECK: Punctuation: ")" [92:26 - 92:27] CallExpr=g:86:8 // Dependent name type -// CHECK: Keyword: "typedef" [100:3 - 100:10] ClassTemplate=X5:98:8 (Definition) +// CHECK: Keyword: "typedef" [100:3 - 100:10] TypedefDecl=iter_type:100:63 (Definition) // CHECK: Keyword: "typename" [100:11 - 100:19] TypedefDecl=iter_type:100:63 (Definition) // CHECK: Identifier: "outer_alias" [100:20 - 100:31] NamespaceRef=outer_alias:10:11 // CHECK: Punctuation: "::" [100:31 - 100:33] TypedefDecl=iter_type:100:63 (Definition) @@ -354,7 +354,7 @@ struct X9 : X8 { // CHECK: Identifier: "iterator" [100:54 - 100:62] TypedefDecl=iter_type:100:63 (Definition) // CHECK: Identifier: "iter_type" [100:63 - 100:72] TypedefDecl=iter_type:100:63 (Definition) -// CHECK: Keyword: "typedef" [101:3 - 101:10] ClassTemplate=X5:98:8 (Definition) +// CHECK: Keyword: "typedef" [101:3 - 101:10] TypedefDecl=int_ptr_type:101:62 (Definition) // CHECK: Keyword: "typename" [101:11 - 101:19] TypedefDecl=int_ptr_type:101:62 (Definition) // CHECK: Identifier: "outer_alias" [101:20 - 101:31] NamespaceRef=outer_alias:10:11 // CHECK: Punctuation: "::" [101:31 - 101:33] TypedefDecl=int_ptr_type:101:62 (Definition) @@ -386,7 +386,7 @@ struct X9 : X8 { // CHECK: Punctuation: ">" [107:74 - 107:75] TypedefDecl=type1:107:76 (Definition) // CHECK: Identifier: "type1" [107:76 - 107:81] TypedefDecl=type1:107:76 (Definition) -// CHECK: Keyword: "typedef" [108:3 - 108:10] ClassTemplate=X6:105:8 (Definition) +// CHECK: Keyword: "typedef" [108:3 - 108:10] TypedefDecl=type2:108:83 (Definition) // CHECK: Keyword: "typename" [108:11 - 108:19] TypedefDecl=type2:108:83 (Definition) // CHECK: Identifier: "outer_alias" [108:20 - 108:31] NamespaceRef=outer_alias:10:11 // CHECK: Punctuation: "::" [108:31 - 108:33] TypedefDecl=type2:108:83 (Definition) @@ -406,7 +406,7 @@ struct X9 : X8 { // CHECK: Identifier: "other" [108:77 - 108:82] TypedefDecl=type2:108:83 (Definition) // CHECK: Identifier: "type2" [108:83 - 108:88] TypedefDecl=type2:108:83 (Definition) -// CHECK: Keyword: "typedef" [109:3 - 109:10] ClassTemplate=X6:105:8 (Definition) +// CHECK: Keyword: "typedef" [109:3 - 109:10] TypedefDecl=type3:109:73 (Definition) // CHECK: Keyword: "class" [109:11 - 109:16] TypedefDecl=type3:109:73 (Definition) // CHECK: Identifier: "outer_alias" [109:17 - 109:28] NamespaceRef=outer_alias:10:11 // CHECK: Punctuation: "::" [109:28 - 109:30] TypedefDecl=type3:109:73 (Definition) @@ -444,7 +444,7 @@ struct X9 : X8 { // CHECK: Identifier: "type4" [110:80 - 110:85] TypedefDecl=type4:110:80 (Definition) // Template template arguments -// CHECK: Keyword: "typedef" [126:3 - 126:10] ClassTemplate=X7:123:8 (Definition) +// CHECK: Keyword: "typedef" [126:3 - 126:10] TypedefDecl=type:126:74 (Definition) // CHECK: Identifier: "outer_alias" [126:11 - 126:22] NamespaceRef=outer_alias:10:11 // CHECK: Punctuation: "::" [126:22 - 126:24] TypedefDecl=type:126:74 (Definition) // CHECK: Identifier: "inner" [126:24 - 126:29] NamespaceRef=inner:114:13 diff --git a/test/Index/annotate-tokens-cxx0x.cpp b/test/Index/annotate-tokens-cxx0x.cpp index a126b85..49f7efb 100644 --- a/test/Index/annotate-tokens-cxx0x.cpp +++ b/test/Index/annotate-tokens-cxx0x.cpp @@ -13,6 +13,17 @@ void test() { bool b2 = __is_trivially_constructible(Integer, Float, Bool); } +typedef int Int; + +class B { + virtual void foo(Int); +}; + +class S : public B { + virtual void foo(Int) override; +}; + + // RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 -fno-delayed-template-parsing -std=c++11 %s | FileCheck %s // CHECK: Identifier: "args" [3:20 - 3:24] SizeOfPackExpr=args:2:15 // CHECK: Identifier: "Args" [3:38 - 3:42] TypeRef=Args:1:22 @@ -25,3 +36,19 @@ void test() { // CHECK-TRAIT: Identifier: "Float" [13:51 - 13:56] TypeRef=Float:11:17 // CHECK-TRAIT: Identifier: "Bool" [13:58 - 13:62] TypeRef=Bool:12:16 +// RUN: c-index-test -test-annotate-tokens=%s:16:1:24:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-WITH-OVERRIDE %s +// CHECK-WITH-OVERRIDE: Keyword: "virtual" [19:2 - 19:9] CXXMethod=foo:19:15 (virtual) +// CHECK-WITH-OVERRIDE: Keyword: "void" [19:10 - 19:14] CXXMethod=foo:19:15 (virtual) +// CHECK-WITH-OVERRIDE: Identifier: "foo" [19:15 - 19:18] CXXMethod=foo:19:15 (virtual) +// CHECK-WITH-OVERRIDE: Punctuation: "(" [19:18 - 19:19] CXXMethod=foo:19:15 (virtual) +// CHECK-WITH-OVERRIDE: Identifier: "Int" [19:19 - 19:22] TypeRef=Int:16:13 +// CHECK-WITH-OVERRIDE: Punctuation: ")" [19:22 - 19:23] ParmDecl=:19:22 (Definition) +// CHECK-WITH-OVERRIDE: Punctuation: ";" [19:23 - 19:24] ClassDecl=B:18:7 (Definition) +// CHECK-WITH-OVERRIDE: Keyword: "virtual" [23:3 - 23:10] CXXMethod=foo:23:16 (virtual) [Overrides @19:15] +// CHECK-WITH-OVERRIDE: Keyword: "void" [23:11 - 23:15] CXXMethod=foo:23:16 (virtual) [Overrides @19:15] +// CHECK-WITH-OVERRIDE: Identifier: "foo" [23:16 - 23:19] CXXMethod=foo:23:16 (virtual) [Overrides @19:15] +// CHECK-WITH-OVERRIDE: Punctuation: "(" [23:19 - 23:20] CXXMethod=foo:23:16 (virtual) [Overrides @19:15] +// CHECK-WITH-OVERRIDE: Identifier: "Int" [23:20 - 23:23] TypeRef=Int:16:13 +// CHECK-WITH-OVERRIDE: Punctuation: ")" [23:23 - 23:24] ParmDecl=:23:23 (Definition) +// CHECK-WITH-OVERRIDE: Keyword: "override" [23:25 - 23:33] attribute(override)= +// CHECK-WITH-OVERRIDE: Punctuation: ";" [23:33 - 23:34] ClassDecl=S:22:7 (Definition) diff --git a/test/Index/annotate-tokens-pp.c b/test/Index/annotate-tokens-pp.c index b37ab39..7da2d6f 100644 --- a/test/Index/annotate-tokens-pp.c +++ b/test/Index/annotate-tokens-pp.c @@ -30,12 +30,24 @@ void test() { const char *fname = __FILE__; -// RUN: c-index-test -test-annotate-tokens=%s:2:1:32:1 -I%S/Inputs %s | FileCheck %s -// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-annotate-tokens=%s:2:1:32:1 -I%S/Inputs %s | FileCheck %s +#define SOME_MACRO 3 + +#ifdef SOME_MACRO +#endif + +struct A +{ +#ifdef SOME_MACRO + int x; +#endif +}; + +// RUN: c-index-test -test-annotate-tokens=%s:2:1:44:1 -I%S/Inputs %s | FileCheck %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-annotate-tokens=%s:2:1:44:1 -I%S/Inputs %s | FileCheck %s // CHECK: Punctuation: "#" [2:1 - 2:2] preprocessing directive= // CHECK: Identifier: "define" [2:2 - 2:8] preprocessing directive= // CHECK: Identifier: "STILL_NOTHING" [2:9 - 2:22] macro definition=STILL_NOTHING -// CHECK: Identifier: "NOTHING" [2:23 - 2:30] macro definition=STILL_NOTHING +// CHECK: Identifier: "NOTHING" [2:23 - 2:30] macro expansion=NOTHING:1:9 // CHECK: Punctuation: "(" [2:30 - 2:31] macro definition=STILL_NOTHING // CHECK: Identifier: "honk" [2:31 - 2:35] macro definition=STILL_NOTHING // CHECK: Punctuation: "," [2:35 - 2:36] macro definition=STILL_NOTHING @@ -180,7 +192,7 @@ const char *fname = __FILE__; // CHECK: Identifier: "x" [25:25 - 25:26] DeclRefExpr=x:24:7 // CHECK: Punctuation: "," [25:26 - 25:27] // CHECK: Punctuation: "{" [25:28 - 25:29] CompoundStmt= -// CHECK: Keyword: "int" [25:30 - 25:33] DeclStmt= +// CHECK: Keyword: "int" [25:30 - 25:33] VarDecl=z:25:34 (Definition) // CHECK: Identifier: "z" [25:34 - 25:35] VarDecl=z:25:34 (Definition) // CHECK: Punctuation: "=" [25:36 - 25:37] VarDecl=z:25:34 (Definition) // CHECK: Identifier: "x" [25:38 - 25:39] DeclRefExpr=x:24:7 @@ -196,3 +208,20 @@ const char *fname = __FILE__; // CHECK: {{28:1.*inclusion directive=pragma-once.h.*multi-include guarded}} // CHECK: {{29:1.*inclusion directive=guarded.h.*multi-include guarded}} // CHECK: Identifier: "__FILE__" [31:21 - 31:29] macro expansion=__FILE__ +// CHECK: Punctuation: "#" [35:1 - 35:2] preprocessing directive= +// CHECK: Identifier: "ifdef" [35:2 - 35:7] preprocessing directive= +// CHECK: Identifier: "SOME_MACRO" [35:8 - 35:18] macro expansion=SOME_MACRO:33:9 +// CHECK: Punctuation: "#" [36:1 - 36:2] preprocessing directive= +// CHECK: Identifier: "endif" [36:2 - 36:7] preprocessing directive= +// CHECK: Keyword: "struct" [38:1 - 38:7] StructDecl=A:38:8 (Definition) +// CHECK: Identifier: "A" [38:8 - 38:9] StructDecl=A:38:8 (Definition) +// CHECK: Punctuation: "{" [39:1 - 39:2] StructDecl=A:38:8 (Definition) +// CHECK: Punctuation: "#" [40:1 - 40:2] preprocessing directive= +// CHECK: Identifier: "ifdef" [40:2 - 40:7] preprocessing directive= +// CHECK: Identifier: "SOME_MACRO" [40:8 - 40:18] macro expansion=SOME_MACRO:33:9 +// CHECK: Keyword: "int" [41:3 - 41:6] FieldDecl=x:41:7 (Definition) +// CHECK: Identifier: "x" [41:7 - 41:8] FieldDecl=x:41:7 (Definition) +// CHECK: Punctuation: ";" [41:8 - 41:9] StructDecl=A:38:8 (Definition) +// CHECK: Punctuation: "#" [42:1 - 42:2] preprocessing directive= +// CHECK: Identifier: "endif" [42:2 - 42:7] preprocessing directive= +// CHECK: Punctuation: "}" [43:1 - 43:2] StructDecl=A:38:8 (Definition) diff --git a/test/Index/annotate-tokens.c b/test/Index/annotate-tokens.c index 0b5f3d4..ffe3f63 100644 --- a/test/Index/annotate-tokens.c +++ b/test/Index/annotate-tokens.c @@ -33,7 +33,31 @@ enum Color g(int i, ...) { } } -// RUN: c-index-test -test-annotate-tokens=%s:4:1:34:1 %s | FileCheck %s +__attribute__((unavailable)) Int __attribute__((unavailable)) test() __attribute__((unavailable)); + +#define HEADER() \ + int x; \ + int y; \ + int z + +#define TYPE_INST(name, ...) \ + static const struct { \ + HEADER(); \ + } name = { \ + __VA_ARGS__ \ + } + +void func1(void); + +TYPE_INST(Foo, + .x = 0, + .y = 1, + .z = 2, +); + +void func2(void); + +// RUN: c-index-test -test-annotate-tokens=%s:4:1:37:1 %s | FileCheck %s // CHECK: Identifier: "T" [4:3 - 4:4] TypeRef=T:1:13 // CHECK: Punctuation: "*" [4:4 - 4:5] VarDecl=t_ptr:4:6 (Definition) // CHECK: Identifier: "t_ptr" [4:6 - 4:11] VarDecl=t_ptr:4:6 (Definition) @@ -74,7 +98,7 @@ enum Color g(int i, ...) { // CHECK: Punctuation: "&" [8:22 - 8:23] UnaryOperator= // CHECK: Identifier: "x" [8:23 - 8:24] DeclRefExpr=x:7:12 // CHECK: Punctuation: ";" [8:24 - 8:25] DeclStmt= -// CHECK: Keyword: "const" [9:3 - 9:8] DeclStmt= +// CHECK: Keyword: "const" [9:3 - 9:8] VarDecl=hello:9:16 (Definition) // CHECK: Keyword: "char" [9:9 - 9:13] VarDecl=hello:9:16 (Definition) // CHECK: Punctuation: "*" [9:14 - 9:15] VarDecl=hello:9:16 (Definition) // CHECK: Identifier: "hello" [9:16 - 9:21] VarDecl=hello:9:16 (Definition) @@ -132,5 +156,71 @@ enum Color g(int i, ...) { // CHECK: Identifier: "Red" [32:12 - 32:15] DeclRefExpr=Red:11:14 // CHECK: Punctuation: ";" [32:15 - 32:16] CompoundStmt= +// CHECK: Keyword: "__attribute__" [36:1 - 36:14] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: "(" [36:14 - 36:15] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: "(" [36:15 - 36:16] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Identifier: "unavailable" [36:16 - 36:27] UnexposedAttr= +// CHECK: Punctuation: ")" [36:27 - 36:28] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: ")" [36:28 - 36:29] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Identifier: "Int" [36:30 - 36:33] TypeRef=Int:12:13 +// CHECK: Keyword: "__attribute__" [36:34 - 36:47] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: "(" [36:47 - 36:48] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: "(" [36:48 - 36:49] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Identifier: "unavailable" [36:49 - 36:60] UnexposedAttr= +// CHECK: Punctuation: ")" [36:60 - 36:61] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: ")" [36:61 - 36:62] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Identifier: "test" [36:63 - 36:67] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: "(" [36:67 - 36:68] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: ")" [36:68 - 36:69] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Keyword: "__attribute__" [36:70 - 36:83] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: "(" [36:83 - 36:84] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: "(" [36:84 - 36:85] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Identifier: "unavailable" [36:85 - 36:96] UnexposedAttr= +// CHECK: Punctuation: ")" [36:96 - 36:97] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: ")" [36:97 - 36:98] FunctionDecl=test:36:63 (unavailable) (always unavailable: "") +// CHECK: Punctuation: ";" [36:98 - 36:99] + // RUN: c-index-test -test-annotate-tokens=%s:4:1:165:32 %s | FileCheck %s // RUN: c-index-test -test-annotate-tokens=%s:4:1:165:38 %s | FileCheck %s + +// RUN: c-index-test -test-annotate-tokens=%s:50:1:55:1 %s | FileCheck %s -check-prefix=CHECK-RANGE1 +// CHECK-RANGE1: Keyword: "void" [50:1 - 50:5] FunctionDecl=func1:50:6 +// CHECK-RANGE1: Identifier: "func1" [50:6 - 50:11] FunctionDecl=func1:50:6 +// CHECK-RANGE1: Punctuation: "(" [50:11 - 50:12] FunctionDecl=func1:50:6 +// CHECK-RANGE1: Keyword: "void" [50:12 - 50:16] FunctionDecl=func1:50:6 +// CHECK-RANGE1: Punctuation: ")" [50:16 - 50:17] FunctionDecl=func1:50:6 +// CHECK-RANGE1: Punctuation: ";" [50:17 - 50:18] +// CHECK-RANGE1: Identifier: "TYPE_INST" [52:1 - 52:10] macro expansion=TYPE_INST:43:9 +// CHECK-RANGE1: Punctuation: "(" [52:10 - 52:11] +// CHECK-RANGE1: Identifier: "Foo" [52:11 - 52:14] VarDecl=Foo:52:11 (Definition) +// CHECK-RANGE1: Punctuation: "," [52:14 - 52:15] +// CHECK-RANGE1: Punctuation: "." [53:5 - 53:6] UnexposedExpr= +// CHECK-RANGE1: Identifier: "x" [53:6 - 53:7] MemberRef=x:52:1 +// CHECK-RANGE1: Punctuation: "=" [53:8 - 53:9] UnexposedExpr= +// CHECK-RANGE1: Literal: "0" [53:10 - 53:11] IntegerLiteral= +// CHECK-RANGE1: Punctuation: "," [53:11 - 53:12] InitListExpr= +// CHECK-RANGE1: Punctuation: "." [54:5 - 54:6] UnexposedExpr= +// CHECK-RANGE1: Identifier: "y" [54:6 - 54:7] MemberRef=y:52:1 +// CHECK-RANGE1: Punctuation: "=" [54:8 - 54:9] UnexposedExpr= +// CHECK-RANGE1: Literal: "1" [54:10 - 54:11] IntegerLiteral= +// CHECK-RANGE1: Punctuation: "," [54:11 - 54:12] InitListExpr= + +// RUN: c-index-test -test-annotate-tokens=%s:54:1:59:1 %s | FileCheck %s -check-prefix=CHECK-RANGE2 +// CHECK-RANGE2: Punctuation: "." [54:5 - 54:6] UnexposedExpr= +// CHECK-RANGE2: Identifier: "y" [54:6 - 54:7] MemberRef=y:52:1 +// CHECK-RANGE2: Punctuation: "=" [54:8 - 54:9] UnexposedExpr= +// CHECK-RANGE2: Literal: "1" [54:10 - 54:11] IntegerLiteral= +// CHECK-RANGE2: Punctuation: "," [54:11 - 54:12] InitListExpr= +// CHECK-RANGE2: Punctuation: "." [55:5 - 55:6] UnexposedExpr= +// CHECK-RANGE2: Identifier: "z" [55:6 - 55:7] MemberRef=z:52:1 +// CHECK-RANGE2: Punctuation: "=" [55:8 - 55:9] UnexposedExpr= +// CHECK-RANGE2: Literal: "2" [55:10 - 55:11] IntegerLiteral= +// CHECK-RANGE2: Punctuation: "," [55:11 - 55:12] InitListExpr= +// CHECK-RANGE2: Punctuation: ")" [56:1 - 56:2] +// CHECK-RANGE2: Punctuation: ";" [56:2 - 56:3] +// CHECK-RANGE2: Keyword: "void" [58:1 - 58:5] FunctionDecl=func2:58:6 +// CHECK-RANGE2: Identifier: "func2" [58:6 - 58:11] FunctionDecl=func2:58:6 +// CHECK-RANGE2: Punctuation: "(" [58:11 - 58:12] FunctionDecl=func2:58:6 +// CHECK-RANGE2: Keyword: "void" [58:12 - 58:16] FunctionDecl=func2:58:6 +// CHECK-RANGE2: Punctuation: ")" [58:16 - 58:17] FunctionDecl=func2:58:6 +// CHECK-RANGE2: Punctuation: ";" [58:17 - 58:18] diff --git a/test/Index/annotate-tokens.m b/test/Index/annotate-tokens.m index 1a48293..7e888e3 100644 --- a/test/Index/annotate-tokens.m +++ b/test/Index/annotate-tokens.m @@ -480,7 +480,7 @@ static Rdar8595462_A * Rdar8595462_staticVar; // CHECK: Identifier: "localVar" [100:10 - 100:18] DeclRefExpr=localVar:99:19 // CHECK: Punctuation: ";" [100:18 - 100:19] CompoundStmt= // CHECK: Punctuation: "}" [101:1 - 101:2] CompoundStmt= -// CHECK: Keyword: "static" [102:1 - 102:7] ObjCImplementationDecl=Rdar8595462_B:97:17 (Definition) +// CHECK: Keyword: "static" [102:1 - 102:7] VarDecl=Rdar8595462_staticVar:102:24 // CHECK: Identifier: "Rdar8595462_A" [102:8 - 102:21] ObjCClassRef=Rdar8595462_A:93:8 // CHECK: Punctuation: "*" [102:22 - 102:23] VarDecl=Rdar8595462_staticVar:102:24 // CHECK: Identifier: "Rdar8595462_staticVar" [102:24 - 102:45] VarDecl=Rdar8595462_staticVar:102:24 diff --git a/test/Index/c-index-api-loadTU-test.m b/test/Index/c-index-api-loadTU-test.m index 7520330..b0fb71e 100644 --- a/test/Index/c-index-api-loadTU-test.m +++ b/test/Index/c-index-api-loadTU-test.m @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast -// RUN: c-index-test -test-load-tu %t.ast all | FileCheck %s +// RUN: c-index-test -test-load-tu %t.ast all > %t 2>&1 && FileCheck --input-file=%t %s @interface Foo { @@ -77,13 +77,14 @@ struct X0 {}; // CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:12 Extent=[4:1 - 12:5] // CHECK: c-index-api-loadTU-test.m:6:32: ObjCIvarDecl=myoutlet:6:32 (Definition) Extent=[6:3 - 6:40] -// CHECK: <invalid loc>:0:0: attribute(iboutlet)= +// CHECK: <invalid loc>:0:0: attribute(iboutlet)= Extent=[6:18 - 6:26] // CHECK: c-index-api-loadTU-test.m:6:29: TypeRef=id:0:0 Extent=[6:29 - 6:31] // CHECK: c-index-api-loadTU-test.m:8:36: ObjCInstanceMethodDecl=myMessage::8:36 Extent=[8:1 - 8:54] -// CHECK: <invalid loc>:0:0: attribute(ibaction)= +// CHECK: <invalid loc>:0:0: attribute(ibaction)= Extent=[8:25 - 8:33] // CHECK: c-index-api-loadTU-test.m:8:50: ParmDecl=msg:8:50 (Definition) Extent=[8:47 - 8:53] // CHECK: c-index-api-loadTU-test.m:8:47: TypeRef=id:0:0 Extent=[8:47 - 8:49] -// CHECK: c-index-api-loadTU-test.m:9:3: ObjCInstanceMethodDecl=foo:9:3 (deprecated) (always deprecated: "") Extent=[9:1 - 9:35] +// CHECK: c-index-api-loadTU-test.m:9:3: ObjCInstanceMethodDecl=foo:9:3 (deprecated) (always deprecated: "") Extent=[9:1 - 9:35] +// CHECK: <invalid loc>:0:0: UnexposedAttr= Extent=[9:22 - 9:32] // CHECK: c-index-api-loadTU-test.m:10:3: ObjCClassMethodDecl=fooC:10:3 Extent=[10:1 - 10:8] // CHECK: c-index-api-loadTU-test.m:14:12: ObjCInterfaceDecl=Bar:14:12 Extent=[14:1 - 18:5] // CHECK: c-index-api-loadTU-test.m:14:18: ObjCSuperClassRef=Foo:4:12 Extent=[14:18 - 14:21] @@ -108,45 +109,57 @@ struct X0 {}; // CHECK: c-index-api-loadTU-test.m:46:5: FunctionDecl=main:46:5 (Definition) Extent=[46:1 - 55:2] // CHECK: c-index-api-loadTU-test.m:46:15: ParmDecl=argc:46:15 (Definition) Extent=[46:11 - 46:19] // CHECK: c-index-api-loadTU-test.m:46:34: ParmDecl=argv:46:34 (Definition) Extent=[46:21 - 46:40] +// CHECK: c-index-api-loadTU-test.m:46:42: CompoundStmt= Extent=[46:42 - 55:2] +// CHECK: c-index-api-loadTU-test.m:47:2: DeclStmt= Extent=[47:2 - 47:12] // CHECK: c-index-api-loadTU-test.m:47:8: VarDecl=bee:47:8 (Definition) Extent=[47:2 - 47:11] // CHECK: c-index-api-loadTU-test.m:47:2: ObjCClassRef=Baz:33:12 Extent=[47:2 - 47:5] +// CHECK: c-index-api-loadTU-test.m:48:2: DeclStmt= Extent=[48:2 - 48:19] // CHECK: c-index-api-loadTU-test.m:48:5: VarDecl=a:48:5 (Definition) Extent=[48:2 - 48:18] // CHECK: c-index-api-loadTU-test.m:48:2: TypeRef=id:0:0 Extent=[48:2 - 48:4] // CHECK: c-index-api-loadTU-test.m:48:9: ObjCMessageExpr=foo:9:3 Extent=[48:9 - 48:18] +// CHECK: c-index-api-loadTU-test.m:48:10: UnexposedExpr=bee:47:8 Extent=[48:10 - 48:13] // CHECK: c-index-api-loadTU-test.m:48:10: DeclRefExpr=bee:47:8 Extent=[48:10 - 48:13] +// CHECK: c-index-api-loadTU-test.m:49:2: DeclStmt= Extent=[49:2 - 49:27] // CHECK: c-index-api-loadTU-test.m:49:12: VarDecl=c:49:12 (Definition) Extent=[49:2 - 49:26] // CHECK: c-index-api-loadTU-test.m:49:2: TypeRef=id:0:0 Extent=[49:2 - 49:4] // CHECK: c-index-api-loadTU-test.m:49:6: ObjCProtocolRef=SubP:29:11 Extent=[49:6 - 49:10] // CHECK: c-index-api-loadTU-test.m:49:16: UnexposedExpr=fooC:10:3 Extent=[49:16 - 49:26] // CHECK: c-index-api-loadTU-test.m:49:16: ObjCMessageExpr=fooC:10:3 Extent=[49:16 - 49:26] // CHECK: c-index-api-loadTU-test.m:49:17: ObjCClassRef=Foo:4:12 Extent=[49:17 - 49:20] +// CHECK: c-index-api-loadTU-test.m:50:2: DeclStmt= Extent=[50:2 - 50:15] // CHECK: c-index-api-loadTU-test.m:50:13: VarDecl=d:50:13 (Definition) Extent=[50:2 - 50:14] // CHECK: c-index-api-loadTU-test.m:50:2: TypeRef=id:0:0 Extent=[50:2 - 50:4] // CHECK: c-index-api-loadTU-test.m:50:6: ObjCProtocolRef=Proto:25:11 Extent=[50:6 - 50:11] // CHECK: c-index-api-loadTU-test.m:51:2: BinaryOperator= Extent=[51:2 - 51:7] // CHECK: c-index-api-loadTU-test.m:51:2: DeclRefExpr=d:50:13 Extent=[51:2 - 51:3] // CHECK: c-index-api-loadTU-test.m:51:6: UnexposedExpr=c:49:12 Extent=[51:6 - 51:7] +// CHECK: c-index-api-loadTU-test.m:51:6: UnexposedExpr=c:49:12 Extent=[51:6 - 51:7] // CHECK: c-index-api-loadTU-test.m:51:6: DeclRefExpr=c:49:12 Extent=[51:6 - 51:7] // CHECK: c-index-api-loadTU-test.m:52:2: ObjCMessageExpr=pMethod:26:3 Extent=[52:2 - 52:13] +// CHECK: c-index-api-loadTU-test.m:52:3: UnexposedExpr=d:50:13 Extent=[52:3 - 52:4] // CHECK: c-index-api-loadTU-test.m:52:3: DeclRefExpr=d:50:13 Extent=[52:3 - 52:4] // CHECK: c-index-api-loadTU-test.m:53:2: ObjCMessageExpr=catMethodWithFloat::21:9 Extent=[53:2 - 53:44] +// CHECK: c-index-api-loadTU-test.m:53:3: UnexposedExpr=bee:47:8 Extent=[53:3 - 53:6] // CHECK: c-index-api-loadTU-test.m:53:3: DeclRefExpr=bee:47:8 Extent=[53:3 - 53:6] // CHECK: c-index-api-loadTU-test.m:53:26: ObjCMessageExpr=floatMethod:22:11 Extent=[53:26 - 53:43] +// CHECK: c-index-api-loadTU-test.m:53:27: UnexposedExpr=bee:47:8 Extent=[53:27 - 53:30] // CHECK: c-index-api-loadTU-test.m:53:27: DeclRefExpr=bee:47:8 Extent=[53:27 - 53:30] // CHECK: c-index-api-loadTU-test.m:54:3: CallExpr=main:46:5 Extent=[54:3 - 54:37] // CHECK: c-index-api-loadTU-test.m:54:3: UnexposedExpr=main:46:5 Extent=[54:3 - 54:7] // CHECK: c-index-api-loadTU-test.m:54:3: DeclRefExpr=main:46:5 Extent=[54:3 - 54:7] // CHECK: c-index-api-loadTU-test.m:54:8: DeclRefExpr=someEnum:43:3 Extent=[54:8 - 54:16] // CHECK: c-index-api-loadTU-test.m:54:18: CStyleCastExpr= Extent=[54:18 - 54:36] +// CHECK: c-index-api-loadTU-test.m:54:33: UnexposedExpr=bee:47:8 Extent=[54:33 - 54:36] // CHECK: c-index-api-loadTU-test.m:54:33: DeclRefExpr=bee:47:8 Extent=[54:33 - 54:36] // CHECK: c-index-api-loadTU-test.m:62:12: ObjCInterfaceDecl=TestAttributes:62:12 Extent=[62:1 - 67:5] -// CHECK: c-index-api-loadTU-test.m:63:15: ObjCIvarDecl=anOutlet:63:15 (Definition) Extent=[58:18 - 63:23] -// CHECK: <invalid loc>:0:0: attribute(iboutlet)= -// CHECK: c-index-api-loadTU-test.m:64:29: ObjCIvarDecl=anOutletCollection:64:29 (Definition) Extent=[59:39 - 64:47] -// CHECK: <invalid loc>:0:0: attribute(iboutletcollection)= [IBOutletCollection=ObjCObjectPointer] +// CHECK: c-index-api-loadTU-test.m:63:15: ObjCIvarDecl=anOutlet:63:15 (Definition) Extent=[63:3 - 63:23] +// CHECK: <invalid loc>:0:0: attribute(iboutlet)= Extent=[63:3 - 63:11] +// CHECK: c-index-api-loadTU-test.m:63:12: TypeRef=id:0:0 Extent=[63:12 - 63:14] +// CHECK: c-index-api-loadTU-test.m:64:29: ObjCIvarDecl=anOutletCollection:64:29 (Definition) Extent=[64:3 - 64:47] +// CHECK: <invalid loc>:0:0: attribute(iboutletcollection)= [IBOutletCollection=ObjCObjectPointer] Extent=[64:3 - 64:25] // CHECK: c-index-api-loadTU-test.m:64:26: TypeRef=id:0:0 Extent=[64:26 - 64:28] // CHECK: c-index-api-loadTU-test.m:66:14: ObjCInstanceMethodDecl=actionMethod::66:14 Extent=[66:1 - 66:35] -// CHECK: <invalid loc>:0:0: attribute(ibaction)= +// CHECK: <invalid loc>:0:0: attribute(ibaction)= Extent=[66:4 - 66:12] // CHECK: c-index-api-loadTU-test.m:66:31: ParmDecl=arg:66:31 (Definition) Extent=[66:28 - 66:34] // CHECK: c-index-api-loadTU-test.m:66:28: TypeRef=id:0:0 Extent=[66:28 - 66:30] // CHECK: c-index-api-loadTU-test.m:69:16: StructDecl=X0:69:16 Extent=[69:9 - 69:18] @@ -154,10 +167,11 @@ struct X0 {}; // CHECK: c-index-api-loadTU-test.m:69:16: TypeRef=struct X0:71:8 Extent=[69:16 - 69:18] // CHECK: c-index-api-loadTU-test.m:70:8: StructDecl=X0:70:8 Extent=[70:1 - 70:10] // CHECK: c-index-api-loadTU-test.m:71:8: StructDecl=X0:71:8 (Definition) Extent=[71:1 - 71:14] - -// CHECK: <invalid loc>:0:0: attribute(iboutlet)= +// CHECK: c-index-api-loadTU-test.m:73:12: ObjCCategoryDecl=:73:12 Extent=[73:1 - 76:5] +// CHECK: c-index-api-loadTU-test.m:73:12: ObjCClassRef=TestAttributes:62:12 Extent=[73:12 - 73:26] +// CHECK: c-index-api-loadTU-test.m:75:32: ObjCPropertyDecl=anotherOutlet:75:32 Extent=[75:1 - 75:45] +// CHECK: <invalid loc>:0:0: attribute(iboutlet)= Extent=[75:20 - 75:28] // CHECK: c-index-api-loadTU-test.m:75:29: TypeRef=id:0:0 Extent=[75:29 - 75:31] // CHECK: c-index-api-loadTU-test.m:75:32: ObjCInstanceMethodDecl=anotherOutlet:75:32 Extent=[75:32 - 75:45] // CHECK: c-index-api-loadTU-test.m:75:32: ObjCInstanceMethodDecl=setAnotherOutlet::75:32 Extent=[75:32 - 75:45] // CHECK: c-index-api-loadTU-test.m:75:32: ParmDecl=anotherOutlet:75:32 (Definition) Extent=[75:32 - 75:45] - diff --git a/test/Index/c-index-getCursor-pp.c b/test/Index/c-index-getCursor-pp.c index 01b0a69..8efaaf2 100644 --- a/test/Index/c-index-getCursor-pp.c +++ b/test/Index/c-index-getCursor-pp.c @@ -1,6 +1,6 @@ #define OBSCURE(X) X #define DECORATION - +#define FNM(X) OBSCURE(X) typedef int T; void OBSCURE(func)(int x) { OBSCURE(T) DECORATION value; @@ -17,6 +17,14 @@ const char *fname = __FILE__; #include <a.h> +#ifdef OBSCURE +#endif + +#if defined(OBSCURE) +#endif + +#define C(A) A + // RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s // CHECK-1: macro definition=OBSCURE // RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s @@ -35,9 +43,21 @@ const char *fname = __FILE__; // CHECK-8: macro expansion=__FILE__ // RUN: c-index-test -cursor-at=%s:18:12 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-9 %s // CHECK-9: inclusion directive=a.h +// RUN: c-index-test -cursor-at=%s:20:10 -cursor-at=%s:23:15 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-10 %s +// CHECK-10: 20:8 macro expansion=OBSCURE +// CHECK-10: 23:13 macro expansion=OBSCURE + +// RUN: c-index-test -cursor-at=%s:3:20 -cursor-at=%s:12:14 \ +// RUN: -cursor-at=%s:26:11 -cursor-at=%s:26:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-IN-MACRODEF %s +// CHECK-IN-MACRODEF: 3:16 macro expansion=OBSCURE +// CHECK-IN-MACRODEF: 12:14 macro expansion=A +// CHECK-IN-MACRODEF: 26:9 macro definition=C +// CHECK-IN-MACRODEF: 26:9 macro definition=C // Same tests, but with "editing" optimizations // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:3:20 -cursor-at=%s:12:14 \ +// RUN: -cursor-at=%s:26:11 -cursor-at=%s:26:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-IN-MACRODEF %s diff --git a/test/Index/c-index-getCursor-test.m b/test/Index/c-index-getCursor-test.m index bae5979..c179902 100644 --- a/test/Index/c-index-getCursor-test.m +++ b/test/Index/c-index-getCursor-test.m @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -detailed-preprocessing-record -o %t.ast -// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck %s +// RUN: c-index-test -test-file-scan %t.ast %s > %t 2>&1 && FileCheck --input-file=%t %s @interface Foo { } diff --git a/test/Index/code-completion-skip-bodies.cpp b/test/Index/code-completion-skip-bodies.cpp index 67b2196..b7570b6 100644 --- a/test/Index/code-completion-skip-bodies.cpp +++ b/test/Index/code-completion-skip-bodies.cpp @@ -11,10 +11,10 @@ void func(S *s) { s->x = 0; } -// RUN: c-index-test -code-completion-at=%s:11:6 %s 2>&1 | FileCheck %s -// CHECK-NOT: error: use of undeclared identifier 'undeclared1' -// CHECK: error: use of undeclared identifier 'undeclared2' -// CHECK: FieldDecl:{ResultType int}{TypedText x} +// RUN: c-index-test -code-completion-at=%s:11:6 %s 2> %t.stderr | FileCheck %s --check-prefix=STDOUT +// RUN: FileCheck --input-file=%t.stderr --check-prefix=STDERR %s -// FIXME: Investigating -// XFAIL: cygwin,mingw32,win32 +// STDOUT: FieldDecl:{ResultType int}{TypedText x} + +// STDERR-NOT: error: use of undeclared identifier 'undeclared1' +// STDERR: error: use of undeclared identifier 'undeclared2' diff --git a/test/Index/codecompletion-chained.cpp b/test/Index/codecompletion-chained.cpp new file mode 100644 index 0000000..93e832f --- /dev/null +++ b/test/Index/codecompletion-chained.cpp @@ -0,0 +1,33 @@ + +// <rdar://12889089> + +#ifndef HEADER1 +#define HEADER1 + +// CHECK-TU: FunctionDecl:{ResultType void}{TypedText foo} +void foo(); + +namespace Cake { +// CHECK-NAMESPACE: FunctionDecl:{ResultType void}{TypedText lie} +void lie(); +} + +#elif !defined(HEADER2) +#define HEADER2 + +namespace Cake { +extern int Baz; +} + +#else + +void func() { +Cake:: +} + +#endif + +// RUN: c-index-test -write-pch %t1.h.pch %s +// RUN: c-index-test -write-pch %t2.h.pch %s -include %t1.h +// RUN: c-index-test -code-completion-at=%s:25:1 %s -include %t2.h | FileCheck -check-prefix=CHECK-TU %s +// RUN: c-index-test -code-completion-at=%s:25:7 %s -include %t2.h | FileCheck -check-prefix=CHECK-NAMESPACE %s diff --git a/test/Index/comment-c-decls.c b/test/Index/comment-c-decls.c new file mode 100644 index 0000000..371e453 --- /dev/null +++ b/test/Index/comment-c-decls.c @@ -0,0 +1,104 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s > %t/out +// RUN: FileCheck %s < %t/out + +// Ensure that XML we generate is not invalid. +// RUN: FileCheck %s -check-prefix=WRONG < %t/out +// WRONG-NOT: CommentXMLInvalid +// rdar://12378714 + +/** + * \brief Aaa. +*/ +int global_function(); +// CHECK: <Declaration>int global_function()</Declaration> + +/** + * \param x1 Aaa. +*/ +extern void external_function(int x1); +// CHECK: <Declaration>extern void external_function(int x1)</Declaration> + +/** + * \brief global variable; +*/ +int global_variable; +// CHECK: <Declaration>int global_variable</Declaration> + +/** + * \brief local variable; +*/ +static int static_variable; +// CHECK: <Declaration>static int static_variable</Declaration> + +/** + * \brief external variable +*/ +extern int external_variable; +// CHECK: <Declaration>extern int external_variable</Declaration> + +int global_function() { + /** + * \brief a local variable + */ + int local = 10; + return local; +} +// CHECK: <Declaration>int global_function()</Declaration> +// CHECK: <Declaration>int local = 10</Declaration> + +/** + * \brief initialized decl. +*/ +int initialized_global = 100; +// CHECK: <Declaration>int initialized_global = 100</Declaration> + +/** + * \brief typedef example +*/ +typedef int INT_T; +// CHECK: <Declaration>typedef int INT_T</Declaration> + +/** + * \brief aggregate type example +*/ +struct S { +/** + * \brief iS1; +*/ + int iS1; +/** + * \brief dS1; +*/ + double dS1; +}; +// CHECK: <Declaration>struct S {}</Declaration> +// CHECK: <Declaration>int iS1</Declaration> +// CHECK: <Declaration>double dS1</Declaration> + +/** + * \brief enum e; +*/ +enum e { + One, +/** + * \brief Two; +*/ + Two, + Three +}; +// CHECK: <Declaration>enum e {}</Declaration> +// CHECK: <Declaration>Two</Declaration> + +/** + *\brief block declaration +*/ +int (^Block) (int i, int j); +// CHECK: <Declaration>int (^Block)(int, int)</Declaration> + +/** + *\brief block declaration +*/ +int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; }; +// CHECK: <Declaration>int (^Block1)(int, int) = ^(int i, int j) {}</Declaration> diff --git a/test/Index/comment-cplus-decls.cpp b/test/Index/comment-cplus-decls.cpp new file mode 100644 index 0000000..de1c2c5 --- /dev/null +++ b/test/Index/comment-cplus-decls.cpp @@ -0,0 +1,171 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s > %t/out +// RUN: FileCheck %s < %t/out + +// Ensure that XML we generate is not invalid. +// RUN: FileCheck %s -check-prefix=WRONG < %t/out +// WRONG-NOT: CommentXMLInvalid +// rdar://12378714 + +/** + * \brief plain c++ class +*/ +class Test +{ +public: +/** + * \brief plain c++ constructor +*/ + Test () : reserved (new data()) {} + +/** + * \brief plain c++ member function +*/ + unsigned getID() const + { + return reserved->objectID; + } +/** + * \brief plain c++ destructor +*/ + ~Test () {} +protected: + struct data { + unsigned objectID; + }; +/** + * \brief plain c++ data field +*/ + data* reserved; +}; +// CHECK: <Declaration>class Test {}</Declaration> +// CHECK: <Declaration>Test() : reserved(new Test::data())</Declaration> +// CHECK: <Declaration>unsigned int getID() const</Declaration> +// CHECK: <Declaration>void ~Test()</Declaration> +// CHECK: <Declaration>Test::data *reserved</Declaration> + + +class S { +/** + * \brief Aaa +*/ + friend class Test; +/** + * \brief Bbb +*/ + friend void foo() {} + +/** + * \brief Ccc +*/ + friend int int_func(); + +/** + * \brief Ddd +*/ + friend bool operator==(const Test &, const Test &); + +/** + * \brief Eee +*/ +template <typename T> friend void TemplateFriend(); + +/** + * \brief Eee +*/ + template <typename T> friend class TemplateFriendClass; + +}; +// CHECK: <Declaration>friend class Test</Declaration> +// CHECK: <Declaration>friend void foo()</Declaration> +// CHECK: <Declaration>friend int int_func()</Declaration> +// CHECK: <Declaration>friend bool operator==(const Test &, const Test &)</Declaration> +// CHECK: <Declaration>friend template <typename T> void TemplateFriend()</Declaration> +// CHECK: <Declaration>friend template <typename T> class TemplateFriendClass</Declaration> + +namespace test0 { + namespace ns { + void f(int); + } + + struct A { +/** + * \brief Fff +*/ + friend void ns::f(int a); + }; +} +// CHECK: <Declaration>friend void f(int a)</Declaration> + +namespace test1 { + template <class T> struct Outer { + void foo(T); + struct Inner { +/** + * \brief Ggg +*/ + friend void Outer::foo(T); + }; + }; +} +// CHECK: <Declaration>friend void foo(T)</Declaration> + +namespace test2 { + namespace foo { + void Func(int x); + } + + class Bar { +/** + * \brief Hhh +*/ + friend void ::test2::foo::Func(int x); + }; +} +// CHECK: <Declaration>friend void Func(int x)</Declaration> + +namespace test3 { + template<class T> class vector { + public: + vector(int i) {} +/** + * \brief Iii +*/ + void f(const T& t = T()) {} + }; + class A { + private: +/** + * \brief Jjj +*/ + friend void vector<A>::f(const A&); + }; +} +// CHECK: <Declaration>void f(const T &t = T())</Declaration> +// CHECK: <Declaration>friend void f(const test3::A &)</Declaration> + +class MyClass +{ +/** + * \brief plain friend test. +*/ + friend class MyClass; +}; +// CHECK: <Declaration>friend class MyClass</Declaration> + +template<class _Tp> class valarray +{ +private: +/** + * \brief template friend test. +*/ + template <class T> friend class valarray; +}; +// CHECK: <Declaration>template <class T> class valarray</Declaration> +// CHECK: <Declaration>friend template <class T> class valarray</Declaration> + +class gslice +{ + valarray<unsigned> __size_; +}; diff --git a/test/Index/comment-cplus-template-decls.cpp b/test/Index/comment-cplus-template-decls.cpp new file mode 100644 index 0000000..039f092 --- /dev/null +++ b/test/Index/comment-cplus-template-decls.cpp @@ -0,0 +1,69 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 std=c++11 %s > %t/out +// RUN: FileCheck %s < %t/out + +// Ensure that XML we generate is not invalid. +// RUN: FileCheck %s -check-prefix=WRONG < %t/out +// WRONG-NOT: CommentXMLInvalid +// rdar://12378714 + +/** + * \brief Aaa +*/ +template<typename T> struct A { +/** + * \brief Bbb +*/ + A(); +/** + * \brief Ccc +*/ + ~A(); +/** + * \brief Ddd +*/ + void f() { } +}; +// CHECK: <Declaration>template <typename T> struct A {}</Declaration> +// CHECK: <Declaration>A<T>()</Declaration> +// CHECK: <Declaration>void ~A<T>()</Declaration> + +/** + * \Brief Eee +*/ +template <typename T> struct D : A<T> { +/** + * \brief +*/ + using A<T>::f; + + void f(); +}; +// CHECK: <Declaration>template <typename T> struct D : A<T> {}</Declaration> +// CHECK: <Declaration>using A<T>::f</Declaration> + +struct Base { + int foo; +}; +/** + * \brief +*/ +template<typename T> struct E : Base { +/** + * \brief +*/ + using Base::foo; +}; +// CHECK: <Declaration>template <typename T> struct E : Base {}</Declaration> +// CHECK: <Declaration>using Base::foo</Declaration> + +/// \tparam +/// \param AAA Blah blah +template<typename T> +void func_template_1(T AAA); +// CHECK: <Declaration>template <typename T> void func_template_1(T AAA)</Declaration> + +template<template<template<typename CCC> class DDD, class BBB> class AAA> +void func_template_2(); +// FIXME: There is not Declaration field in the generated output. diff --git a/test/Index/comment-custom-block-command.cpp b/test/Index/comment-custom-block-command.cpp new file mode 100644 index 0000000..80a58ca --- /dev/null +++ b/test/Index/comment-custom-block-command.cpp @@ -0,0 +1,38 @@ +// RUN: rm -rf %t +// RUN: mkdir %t + +// Check that custom block commands are defined correctly. +// RUN: %clang_cc1 -fcomment-block-commands=CustomCommand -x c++ -std=c++11 -emit-pch -o %t/out.pch %s +// RUN: %clang_cc1 -x c++ -std=c++11 -fcomment-block-commands=CustomCommand -include-pch %t/out.pch -fsyntax-only %s + +// 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 +// RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch + +// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct +// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch + +// Ensure that XML is not invalid +// WRONG-NOT: CommentXMLInvalid + +// RUN: FileCheck %s < %t/out.c-index-direct +// RUN: FileCheck %s < %t/out.c-index-pch + +// XFAIL: valgrind + +#ifndef HEADER +#define HEADER + +/// \CustomCommand Aaa. +void comment_custom_block_command_1(); + +// 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>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[CustomCommand] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] + +#endif + diff --git a/test/Index/comment-objc-decls.m b/test/Index/comment-objc-decls.m new file mode 100644 index 0000000..ae3b0bb --- /dev/null +++ b/test/Index/comment-objc-decls.m @@ -0,0 +1,175 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s > %t/out +// RUN: FileCheck %s < %t/out + +// Ensure that XML we generate is not invalid. +// RUN: FileCheck %s -check-prefix=WRONG < %t/out +// WRONG-NOT: CommentXMLInvalid + +// rdar://12378714 + +/** + * \brief This is a protocol definition +*/ +@protocol MyProto +@optional +/** + * \brief MethodMyProto method + * \param[in] anObject input value + * \param[in] range output value is unsigned int + * \result return index + */ +- (unsigned int)MethodMyProto:(id)anObject inRange:(unsigned int)range; +/** + * \brief PropertyMyProto - This is protocol's property. +*/ +@property (copy) id PropertyMyProto; +/** + * \brief ClassMethodMyProto +*/ ++ ClassMethodMyProto; +@end +// CHECK: <Declaration>@protocol MyProto\n@end</Declaration> +// CHECK: <Declaration>- (unsigned int)MethodMyProto:(id)anObject inRange:(unsigned int)range;</Declaration> +// CHECK: <Declaration>@optional\n@property(readwrite, copy, atomic) id PropertyMyProto;</Declaration> +// CHECK: <Declaration>+ (id)ClassMethodMyProto;</Declaration> + +/** + * \brief NSObject is the root class. +*/ +@interface NSObject { +/** + * \brief IvarNSObject +*/ + id IvarNSObject; +} +@end +// CHECK: Declaration>@interface NSObject {\n id IvarNSObject;\n}\n@end</Declaration> +// CHECK: <Declaration>id IvarNSObject</Declaration> + +/** + * \brief MyClass - primary class. +*/ +@interface MyClass : NSObject<MyProto> +{ +/** + * \brief IvarMyClass - IvarMyClass of values. +*/ + id IvarMyClass; +} +/** + * \brief MethodMyClass is instance method. +*/ +- MethodMyClass; + +/** + * \brief ClassMethodMyClass is class method. +*/ ++ ClassMethodMyClass; + +/** + * \brief PropertyMyClass - This is class's property. +*/ +@property (copy) id PropertyMyClass; +@end +// CHECK: <Declaration>@interface MyClass : NSObject <MyProto> {\n id IvarMyClass;\n}\n@end</Declaration> +// CHECK: <Declaration>id IvarMyClass</Declaration> +// CHECK: <Declaration>- (id)MethodMyClass;</Declaration> +// CHECK: <Declaration>+ (id)ClassMethodMyClass;</Declaration> +// CHECK: <Declaration>@property(readwrite, copy, atomic) id PropertyMyClass;</Declaration + +/** + * \brief - This is class extension of MyClass +*/ +@interface MyClass() +{ +/** + * \brief IvarMyClassExtension - IvarMyClassExtension private to class extension +*/ + id IvarMyClassExtension; +} +@end +// CHECK: <Declaration>@interface MyClass () {\n id IvarMyClassExtension;\n}\n@end</Declaration> +// CHECK: <Declaration>id IvarMyClassExtension</Declaration> + + +/** + * \brief MyClass (Category) is private to MyClass. +*/ +@interface MyClass (Category) +/** + * \brief This is private to MyClass + */ +- (void)MethodMyClassCategory; + +/** + * \brief PropertyMyClassCategory - This is class's private property. +*/ +@property (copy) id PropertyMyClassCategory; +@end +// CHECK: <Declaration>@interface MyClass (Category)\n@end</Declaration> +// CHECK: <Declaration>- (void)MethodMyClassCategory;</Declaration> +// CHECK: <Declaration>@property(readwrite, copy, atomic) id PropertyMyClassCategory;</Declaration> +// CHECK: <Declaration>- (id)PropertyMyClassCategory;</Declaration> +// CHECK: <Declaration>- (void)setPropertyMyClassCategory:(id)arg;</Declaration> + +/// @implementation's + +/** + * \brief implementation of MyClass class. +*/ +@implementation MyClass { +/** + * \brief IvarPrivateToMyClassImpl. +*/ + id IvarPrivateToMyClassImpl; +} +/** + * \brief MethodMyClass is instance method implementation. +*/ +- MethodMyClass { + return 0; +} + +/** + * \brief ClassMethodMyClass is class method implementation. +*/ ++ ClassMethodMyClass { + return 0; +} +@end +// CHECK: <Declaration>@implementation MyClass {\n id IvarPrivateToMyClassImpl;\n id _PropertyMyClass;\n}\n@end</Declaration> +// CHECK: <Declaration>id IvarPrivateToMyClassImpl</Declaration> +// CHECK: <Declaration>- (id)MethodMyClass;</Declaration> +// CHECK: <Declaration>+ (id)ClassMethodMyClass;</Declaration> + +/** + * \brief MyClass (Category) is implementation of private to MyClass. +*/ +@implementation MyClass (Category) +/** + * \brief This is private to MyClass + */ +- (void)MethodMyClassCategory {} +/** + * \brief property getter +*/ +- (id) PropertyMyClassCategory { return 0; } + +/** + * \brief property setter +*/ +- (void) setPropertyMyClassCategory : (id) arg {} +@end +// CHECK: <Declaration>@implementation MyClass (Category)\n@end</Declaration> +// CHECK: <Declaration>- (void)MethodMyClassCategory;</Declaration> +// CHECK: <Declaration>- (id)PropertyMyClassCategory;</Declaration> +// CHECK: <Declaration>- (void)setPropertyMyClassCategory:(id)arg;</Declaration> + +/** + * \brief NSObject implementation +*/ +@implementation NSObject +@end +// CHECK: <Declaration>@implementation NSObject\n@end</Declaration> diff --git a/test/Index/comment-to-html-xml-conversion.cpp b/test/Index/comment-to-html-xml-conversion.cpp new file mode 100644 index 0000000..c770ca8 --- /dev/null +++ b/test/Index/comment-to-html-xml-conversion.cpp @@ -0,0 +1,797 @@ +// RUN: rm -rf %t +// RUN: mkdir %t + +// This file contains UTF-8 sequences. Please don't "fix" them! + +// Check that we serialize comment source locations properly. +// RUN: %clang_cc1 -x c++ -std=c++11 -emit-pch -o %t/out.pch %s +// RUN: %clang_cc1 -x c++ -std=c++11 -include-pch %t/out.pch -fsyntax-only %s + +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 > %t/out.c-index-direct +// RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch + +// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct +// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch + +// Ensure that XML is not invalid +// WRONG-NOT: CommentXMLInvalid + +// RUN: FileCheck %s < %t/out.c-index-direct +// RUN: FileCheck %s < %t/out.c-index-pch + +// XFAIL: msan +// XFAIL: valgrind + +#ifndef HEADER +#define HEADER + +/// Aaa. +void comment_to_html_conversion_1(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_1:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_1</Name><USR>c:@F@comment_to_html_conversion_1#</USR><Declaration>void comment_to_html_conversion_1()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])))] + +/// \brief Aaa. +void comment_to_html_conversion_2(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_2:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_2</Name><USR>c:@F@comment_to_html_conversion_2#</USR><Declaration>void comment_to_html_conversion_2()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] + +/// \short Aaa. +void comment_to_html_conversion_3(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_3:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_3</Name><USR>c:@F@comment_to_html_conversion_3#</USR><Declaration>void comment_to_html_conversion_3()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[short] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] + +/// Aaa. +/// +/// \brief Bbb. +void comment_to_html_conversion_4(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_4:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Bbb.</p><p> Aaa.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_4</Name><USR>c:@F@comment_to_html_conversion_4#</USR><Declaration>void comment_to_html_conversion_4()</Declaration><Abstract><Para> Bbb.</Para></Abstract><Discussion><Para> Aaa.</Para></Discussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] + +/// Aaa. +/// +/// \brief Bbb. +/// +/// Ccc. +void comment_to_html_conversion_5(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_5:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Bbb.</p><p> Aaa.</p><p> Ccc.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_5</Name><USR>c:@F@comment_to_html_conversion_5#</USR><Declaration>void comment_to_html_conversion_5()</Declaration><Abstract><Para> Bbb.</Para></Abstract><Discussion><Para> Aaa.</Para><Para> Ccc.</Para></Discussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))) +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Ccc.])))] + +/// \brief Aaa. +/// \brief Bbb. +void comment_to_html_conversion_6(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_6:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa. </p><p class="para-brief"> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_6</Name><USR>c:@F@comment_to_html_conversion_6#</USR><Declaration>void comment_to_html_conversion_6()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Discussion><Para> Bbb.</Para></Discussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] + +/// Aaa. +/// +/// \return Bbb. +void comment_to_html_conversion_7(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_7:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_7</Name><USR>c:@F@comment_to_html_conversion_7#</USR><Declaration>void comment_to_html_conversion_7()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[return] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] + +/// Aaa. +/// +/// \returns Bbb. +void comment_to_html_conversion_8(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_8:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_8</Name><USR>c:@F@comment_to_html_conversion_8#</USR><Declaration>void comment_to_html_conversion_8()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] + +/// Aaa. +/// +/// \result Bbb. +void comment_to_html_conversion_9(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_9:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_9</Name><USR>c:@F@comment_to_html_conversion_9#</USR><Declaration>void comment_to_html_conversion_9()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[result] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] + +/// \returns Aaa. +/// \returns Bbb. +void comment_to_html_conversion_10(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_10:{{.*}} FullCommentAsHTML=[<p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p><p class="para-returns"><span class="word-returns">Returns</span> Aaa. </p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_10</Name><USR>c:@F@comment_to_html_conversion_10#</USR><Declaration>void comment_to_html_conversion_10()</Declaration><ResultDiscussion><Para> Aaa. </Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] + +/// Aaa. +/// +/// Bbb. +/// +/// \returns Ccc. +void comment_to_html_conversion_11(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_11:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p> Bbb.</p><p class="para-returns"><span class="word-returns">Returns</span> Ccc.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_11</Name><USR>c:@F@comment_to_html_conversion_11#</USR><Declaration>void comment_to_html_conversion_11()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Ccc.</Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.])) +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.])) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Ccc.]))))] + +/// \param +void comment_to_html_conversion_12(int x1); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_12:{{.*}} FullCommentAsHTML=[] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_12</Name><USR>c:@F@comment_to_html_conversion_12#I#</USR><Declaration>void comment_to_html_conversion_12(int x1)</Declaration></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[] ParamIndex=Invalid +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace)))] + +/// \param x1 Aaa. +void comment_to_html_conversion_13(int x1); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_13:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Aaa.</dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_13</Name><USR>c:@F@comment_to_html_conversion_13#I#</USR><Declaration>void comment_to_html_conversion_13(int x1)</Declaration><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa.</Para></Discussion></Parameter></Parameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x1] ParamIndex=0 +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] + +/// \param zzz Aaa. +void comment_to_html_conversion_14(int x1); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_14:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-invalid">zzz</dt><dd class="param-descr-index-invalid"> Aaa.</dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_14</Name><USR>c:@F@comment_to_html_conversion_14#I#</USR><Declaration>void comment_to_html_conversion_14(int x1)</Declaration><Parameters><Parameter><Name>zzz</Name><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa.</Para></Discussion></Parameter></Parameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[zzz] ParamIndex=Invalid +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] + +/// \param x2 Bbb. +/// \param x1 Aaa. +void comment_to_html_conversion_15(int x1, int x2); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_15:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Aaa.</dd><dt class="param-name-index-1">x2</dt><dd class="param-descr-index-1"> Bbb. </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_15</Name><USR>c:@F@comment_to_html_conversion_15#I#I#</USR><Declaration>void comment_to_html_conversion_15(int x1, int x2)</Declaration><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa.</Para></Discussion></Parameter><Parameter><Name>x2</Name><Index>1</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Bbb. </Para></Discussion></Parameter></Parameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x2] ParamIndex=1 +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x1] ParamIndex=0 +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] + +/// \param x2 Bbb. +/// \param zzz Aaa. +/// \param x1 Aaa. +void comment_to_html_conversion_16(int x1, int x2); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_16:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Aaa.</dd><dt class="param-name-index-1">x2</dt><dd class="param-descr-index-1"> Bbb. </dd><dt class="param-name-index-invalid">zzz</dt><dd class="param-descr-index-invalid"> Aaa. </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_16</Name><USR>c:@F@comment_to_html_conversion_16#I#I#</USR><Declaration>void comment_to_html_conversion_16(int x1, int x2)</Declaration><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa.</Para></Discussion></Parameter><Parameter><Name>x2</Name><Index>1</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Bbb. </Para></Discussion></Parameter><Parameter><Name>zzz</Name><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa. </Para></Discussion></Parameter></Parameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x2] ParamIndex=1 +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[zzz] ParamIndex=Invalid +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x1] ParamIndex=0 +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))] + +/// \tparam +/// \param aaa Blah blah +template<typename T> +void comment_to_html_conversion_17(T aaa); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_17:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">aaa</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_17#t0.0#</USR><Declaration>template <typename T> void comment_to_html_conversion_17(T aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[] ParamPosition=Invalid +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[aaa] ParamIndex=0 +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Blah blah]))))] + +/// \tparam T +/// \param aaa Blah blah +template<typename T> +void comment_to_html_conversion_18(T aaa); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_18:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">aaa</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_18</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_18#t0.0#</USR><Declaration>template <typename T> void comment_to_html_conversion_18(T aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T] ParamPosition={0} +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[aaa] ParamIndex=0 +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Blah blah]))))] + +/// \tparam T2 Bbb +/// \tparam T1 Aaa +template<typename T1, typename T2> +void comment_to_html_conversion_19(T1 aaa, T2 bbb); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_19:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">T1</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">T2</dt><dd class="tparam-descr-index-1"> Bbb </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@>2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><Declaration>template <typename T1, typename T2>\nvoid comment_to_html_conversion_19(T1 aaa, T2 bbb)</Declaration><TemplateParameters><Parameter><Name>T1</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>T2</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T2] ParamPosition={1} +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T1] ParamPosition={0} +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa]))))] + +/// \tparam T2 Bbb +/// \tparam U Zzz +/// \tparam V Ccc +/// \tparam T1 Aaa +template<typename T1, typename T2, int V> +void comment_to_html_conversion_20(T1 aaa, T2 bbb); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_20:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">T1</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">T2</dt><dd class="tparam-descr-index-1"> Bbb </dd><dt class="tparam-name-index-2">V</dt><dd class="tparam-descr-index-2"> Ccc </dd><dt class="tparam-name-index-invalid">U</dt><dd class="tparam-descr-index-invalid"> Zzz </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@>3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><Declaration>template <typename T1, typename T2, int V>\nvoid comment_to_html_conversion_20(T1 aaa, T2 bbb)</Declaration><TemplateParameters><Parameter><Name>T1</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>T2</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>V</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>U</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T2] ParamPosition={1} +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[U] ParamPosition=Invalid +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Zzz] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[V] ParamPosition={2} +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Ccc] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T1] ParamPosition={0} +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa]))))] + +/// \tparam TTT Ddd +/// \tparam C Ccc +/// \tparam T Aaa +/// \tparam TT Bbb +template<template<template<typename T> class TT, class C> class TTT> +void comment_to_html_conversion_21(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_21:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">TTT</dt><dd class="tparam-descr-index-0"> Ddd </dd><dt class="tparam-name-index-other">C</dt><dd class="tparam-descr-index-other"> Ccc </dd><dt class="tparam-name-index-other">T</dt><dd class="tparam-descr-index-other"> Aaa </dd><dt class="tparam-name-index-other">TT</dt><dd class="tparam-descr-index-other"> Bbb</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@>1#t>2#t>1#T#Tcomment_to_html_conversion_21#</USR><Declaration>template <template <template <typename T> class TT, class C> class TTT>\nvoid comment_to_html_conversion_21()</Declaration><TemplateParameters><Parameter><Name>TTT</Name><Index>0</Index><Discussion><Para> Ddd </Para></Discussion></Parameter><Parameter><Name>C</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>T</Name><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>TT</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[TTT] ParamPosition={0} +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Ddd] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[C] ParamPosition={0, 1} +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Ccc] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[T] ParamPosition={0, 0, 0} +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[TT] ParamPosition={0, 0} +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb]))))] + +/// \brief Aaa. +/// +/// Bbb. +/// +/// \param x2 Ddd. +/// \param x1 Ccc. +/// \returns Eee. +void comment_to_html_conversion_22(int x1, int x2); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_22:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p> Bbb.</p><dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Ccc. </dd><dt class="param-name-index-1">x2</dt><dd class="param-descr-index-1"> Ddd. </dd></dl><p class="para-returns"><span class="word-returns">Returns</span> Eee.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@F@comment_to_html_conversion_22#I#I#</USR><Declaration>void comment_to_html_conversion_22(int x1, int x2)</Declaration><Abstract><Para> Aaa.</Para></Abstract><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Ccc. </Para></Discussion></Parameter><Parameter><Name>x2</Name><Index>1</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Ddd. </Para></Discussion></Parameter></Parameters><ResultDiscussion><Para> Eee.</Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))) +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Bbb.])) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x2] ParamIndex=1 +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Ddd.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x1] ParamIndex=0 +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Ccc.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[returns] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Eee.]))))] + +/// <br><a href="http://example.com/">Aaa</a> +void comment_to_html_conversion_23(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_23:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <br><a href="http://example.com/">Aaa</a></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_23</Name><USR>c:@F@comment_to_html_conversion_23#</USR><Declaration>void comment_to_html_conversion_23()</Declaration><Abstract><Para> <rawHTML><![CDATA[<br>]]></rawHTML><rawHTML><![CDATA[<a href="http://example.com/">]]></rawHTML>Aaa<rawHTML></a></rawHTML></Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_HTMLStartTag Name=[br]) +// CHECK-NEXT: (CXComment_HTMLStartTag Name=[a] Attrs: href=http://example.com/) +// CHECK-NEXT: (CXComment_Text Text=[Aaa]) +// CHECK-NEXT: (CXComment_HTMLEndTag Name=[a])))] + +/// \verbatim +/// <a href="http://example.com/">Aaa</a> +/// <a href='http://example.com/'>Aaa</a> +/// \endverbatim +void comment_to_html_conversion_24(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_24:{{.*}} FullCommentAsHTML=[<pre> <a href="http://example.com/">Aaa</a>\n <a href='http://example.com/'>Aaa</a></pre>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_24</Name><USR>c:@F@comment_to_html_conversion_24#</USR><Declaration>void comment_to_html_conversion_24()</Declaration><Discussion><Verbatim xml:space="preserve" kind="verbatim"> <a href="http://example.com/">Aaa</a>\n <a href='http://example.com/'>Aaa</a></Verbatim></Discussion></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_VerbatimBlockCommand CommandName=[verbatim] +// CHECK-NEXT: (CXComment_VerbatimBlockLine Text=[ <a href="http://example.com/">Aaa</a>]) +// CHECK-NEXT: (CXComment_VerbatimBlockLine Text=[ <a href='http://example.com/'>Aaa</a>])))] + +/// \function foo +/// \class foo +/// \method foo +/// \interface foo +/// Blah blah. +void comment_to_html_conversion_25(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_25:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Blah blah.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_25</Name><USR>c:@F@comment_to_html_conversion_25#</USR><Declaration>void comment_to_html_conversion_25()</Declaration><Abstract><Para> Blah blah.</Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo]) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo]) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo]) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo]) +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Blah blah.])))] + +/// \unknown +void comment_to_html_conversion_26(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_26:{{.*}} FullCommentAsHTML=[<p class="para-brief"> </p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_26</Name><USR>c:@F@comment_to_html_conversion_26#</USR><Declaration>void comment_to_html_conversion_26()</Declaration><Abstract><Para> </Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[unknown] RenderNormal)))] + +/// \b Aaa +void comment_to_html_conversion_27(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_27:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <b>Aaa</b></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_27</Name><USR>c:@F@comment_to_html_conversion_27#</USR><Declaration>void comment_to_html_conversion_27()</Declaration><Abstract><Para> <bold>Aaa</bold></Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[b] RenderBold Arg[0]=Aaa)))] + +/// \c Aaa \p Bbb +void comment_to_html_conversion_28(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_28:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <tt>Aaa</tt> <tt>Bbb</tt></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_28</Name><USR>c:@F@comment_to_html_conversion_28#</USR><Declaration>void comment_to_html_conversion_28()</Declaration><Abstract><Para> <monospaced>Aaa</monospaced> <monospaced>Bbb</monospaced></Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[c] RenderMonospaced Arg[0]=Aaa) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[p] RenderMonospaced Arg[0]=Bbb)))] + +/// \a Aaa \e Bbb \em Ccc +void comment_to_html_conversion_29(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_29:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>Aaa</em> <em>Bbb</em> <em>Ccc</em></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_29</Name><USR>c:@F@comment_to_html_conversion_29#</USR><Declaration>void comment_to_html_conversion_29()</Declaration><Abstract><Para> <emphasized>Aaa</emphasized> <emphasized>Bbb</emphasized> <emphasized>Ccc</emphasized></Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[a] RenderEmphasized Arg[0]=Aaa) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[e] RenderEmphasized Arg[0]=Bbb) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[em] RenderEmphasized Arg[0]=Ccc)))] + +/// \a 1<2 \e 3<4 \em 5<6 \param 7<8 aaa \tparam 9<10 bbb +void comment_to_html_conversion_30(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_30:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>1<2</em> <em>3<4</em> <em>5<6</em> </p><dl><dt class="tparam-name-index-invalid">9<10</dt><dd class="tparam-descr-index-invalid"> bbb</dd></dl><dl><dt class="param-name-index-invalid">7<8</dt><dd class="param-descr-index-invalid"> aaa </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_30</Name><USR>c:@F@comment_to_html_conversion_30#</USR><Declaration>void comment_to_html_conversion_30()</Declaration><Abstract><Para> <emphasized>1<2</emphasized> <emphasized>3<4</emphasized> <emphasized>5<6</emphasized> </Para></Abstract><TemplateParameters><Parameter><Name>9<10</Name><Discussion><Para> bbb</Para></Discussion></Parameter></TemplateParameters><Parameters><Parameter><Name>7<8</Name><Direction isExplicit="0">in</Direction><Discussion><Para> aaa </Para></Discussion></Parameter></Parameters></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[a] RenderEmphasized Arg[0]=1<2) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[e] RenderEmphasized Arg[0]=3<4) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_InlineCommand CommandName=[em] RenderEmphasized Arg[0]=5<6) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[7<8] ParamIndex=Invalid +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ aaa ]))) +// CHECK-NEXT: (CXComment_TParamCommand ParamName=[9<10] ParamPosition=Invalid +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ bbb]))))] + +/// \\ \@ \& \$ \# \< \> \% \" \. \:: +void comment_to_html_conversion_31(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_31:{{.*}} FullCommentAsHTML=[<p class="para-brief"> \ @ & $ # < > % " . ::</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_31</Name><USR>c:@F@comment_to_html_conversion_31#</USR><Declaration>void comment_to_html_conversion_31()</Declaration><Abstract><Para> \ @ & $ # < > % " . ::</Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[\]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[@]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[&]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[$]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[#]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[<]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[>]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[%]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=["]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[.]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[::])))] + +/// & < > " ' meow meow +void comment_to_html_conversion_32(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_32:{{.*}} FullCommentAsHTML=[<p class="para-brief"> & < > " ' meow meow</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_32</Name><USR>c:@F@comment_to_html_conversion_32#</USR><Declaration>void comment_to_html_conversion_32()</Declaration><Abstract><Para> & < > " ' meow meow</Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[&]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[<]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[>]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=["]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[']) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[m]) +// CHECK-NEXT: (CXComment_Text Text=[e]) +// CHECK-NEXT: (CXComment_Text Text=[o]) +// CHECK-NEXT: (CXComment_Text Text=[w]) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[m]) +// CHECK-NEXT: (CXComment_Text Text=[e]) +// CHECK-NEXT: (CXComment_Text Text=[o]) +// CHECK-NEXT: (CXComment_Text Text=[w])))] + +/// <em>0<i</em> +void comment_to_html_conversion_33(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_33:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>0<i</em></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_33</Name><USR>c:@F@comment_to_html_conversion_33#</USR><Declaration>void comment_to_html_conversion_33()</Declaration><Abstract><Para> <rawHTML><![CDATA[<em>]]></rawHTML>0<i<rawHTML></em></rawHTML></Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_HTMLStartTag Name=[em]) +// CHECK-NEXT: (CXComment_Text Text=[0]) +// CHECK-NEXT: (CXComment_Text Text=[<]) +// CHECK-NEXT: (CXComment_Text Text=[i]) +// CHECK-NEXT: (CXComment_HTMLEndTag Name=[em])))] + +// rdar://12392215 +/// © the copyright symbol +/// ™ the trade mark symbol +/// ® the registered trade mark symbol +/// a non breakable space. +/// Δ Greek letter Delta Δ. +/// Γ Greek letter Gamma Γ. +void comment_to_html_conversion_34(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_34:{{.*}} FullCommentAsHTML=[<p class="para-brief"> © the copyright symbol â„¢ the trade mark symbol ® the registered trade mark symbol  a non breakable space. Δ Greek letter Delta Δ. Γ Greek letter Gamma Γ.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_34</Name><USR>c:@F@comment_to_html_conversion_34#</USR><Declaration>void comment_to_html_conversion_34()</Declaration><Abstract><Para> © the copyright symbol â„¢ the trade mark symbol ® the registered trade mark symbol  a non breakable space. Δ Greek letter Delta Δ. Γ Greek letter Gamma Γ.</Para></Abstract></Function>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[©]) +// CHECK-NEXT: (CXComment_Text Text=[ the copyright symbol] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[â„¢]) +// CHECK-NEXT: (CXComment_Text Text=[ the trade mark symbol] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[®]) +// CHECK-NEXT: (CXComment_Text Text=[ the registered trade mark symbol] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[ ]) +// CHECK-NEXT: (CXComment_Text Text=[ a non breakable space.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[Δ]) +// CHECK-NEXT: (CXComment_Text Text=[ Greek letter Delta Δ.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[Γ]) +// CHECK-NEXT: (CXComment_Text Text=[ Greek letter Gamma Γ.])))] + + +/// Aaa. +class comment_to_xml_conversion_01 { +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:7: ClassDecl=comment_to_xml_conversion_01:{{.*}} FullCommentAsXML=[<Class file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="7"><Name>comment_to_xml_conversion_01</Name><USR>c:@C@comment_to_xml_conversion_01</USR><Declaration>class comment_to_xml_conversion_01 {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Class>] + + /// \param aaa Blah blah. + comment_to_xml_conversion_01(int aaa); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:3: CXXConstructor=comment_to_xml_conversion_01:{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="3"><Name>comment_to_xml_conversion_01</Name><USR>c:@C@comment_to_xml_conversion_01@F@comment_to_xml_conversion_01#I#</USR><Declaration>comment_to_xml_conversion_01(int aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah.</Para></Discussion></Parameter></Parameters></Function>] + + /// Aaa. + ~comment_to_xml_conversion_01(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:3: CXXDestructor=~comment_to_xml_conversion_01:{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="3"><Name>~comment_to_xml_conversion_01</Name><USR>c:@C@comment_to_xml_conversion_01@F@~comment_to_xml_conversion_01#</USR><Declaration>void ~comment_to_xml_conversion_01()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] + + /// \param aaa Blah blah. + int comment_to_xml_conversion_02(int aaa); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:7: CXXMethod=comment_to_xml_conversion_02:{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="7"><Name>comment_to_xml_conversion_02</Name><USR>c:@C@comment_to_xml_conversion_01@F@comment_to_xml_conversion_02#I#</USR><Declaration>int comment_to_xml_conversion_02(int aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah.</Para></Discussion></Parameter></Parameters></Function>] + + /// \param aaa Blah blah. + static int comment_to_xml_conversion_03(int aaa); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:14: CXXMethod=comment_to_xml_conversion_03:{{.*}} FullCommentAsXML=[<Function isClassMethod="1" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="14"><Name>comment_to_xml_conversion_03</Name><USR>c:@C@comment_to_xml_conversion_01@F@comment_to_xml_conversion_03#I#S</USR><Declaration>static int comment_to_xml_conversion_03(int aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah.</Para></Discussion></Parameter></Parameters></Function>] + + /// Aaa. + int comment_to_xml_conversion_04; + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:7: FieldDecl=comment_to_xml_conversion_04:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="7"><Name>comment_to_xml_conversion_04</Name><USR>c:@C@comment_to_xml_conversion_01@FI@comment_to_xml_conversion_04</USR><Declaration>int comment_to_xml_conversion_04</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] + + /// Aaa. + static int comment_to_xml_conversion_05; + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:14: VarDecl=comment_to_xml_conversion_05:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="14"><Name>comment_to_xml_conversion_05</Name><USR>c:@C@comment_to_xml_conversion_01@comment_to_xml_conversion_05</USR><Declaration>static int comment_to_xml_conversion_05</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] + + /// \param aaa Blah blah. + void operator()(int aaa); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:8: CXXMethod=operator():{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="8"><Name>operator()</Name><USR>c:@C@comment_to_xml_conversion_01@F@operator()#I#</USR><Declaration>void operator()(int aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah.</Para></Discussion></Parameter></Parameters></Function>] + + /// Aaa. + operator bool(); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:3: CXXConversion=operator _Bool:{{.*}} FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="3"><Name>operator _Bool</Name><USR>c:@C@comment_to_xml_conversion_01@F@operator _Bool#</USR><Declaration>bool operator _Bool()</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] + + /// Aaa. + typedef int comment_to_xml_conversion_06; + +// USR is line-dependent here, so filter it with a regexp. +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-3]]:15: TypedefDecl=comment_to_xml_conversion_06:{{.*}} FullCommentAsXML=[<Typedef file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-3]]" column="15"><Name>comment_to_xml_conversion_06</Name><USR>{{[^<]+}}</USR><Declaration>typedef int comment_to_xml_conversion_06</Declaration><Abstract><Para> Aaa.</Para></Abstract></Typedef>] + + /// Aaa. + using comment_to_xml_conversion_07 = int; + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:9: TypeAliasDecl=comment_to_xml_conversion_07:{{.*}} FullCommentAsXML=[<Typedef file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="9"><Name>comment_to_xml_conversion_07</Name><USR>c:@C@comment_to_xml_conversion_01@comment_to_xml_conversion_07</USR><Declaration>using comment_to_xml_conversion_07 = int</Declaration><Abstract><Para> Aaa.</Para></Abstract></Typedef>] + + /// Aaa. + template<typename T, typename U> + class comment_to_xml_conversion_08 { }; + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:9: ClassTemplate=comment_to_xml_conversion_08:{{.*}} FullCommentAsXML=[<Class templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="9"><Name>comment_to_xml_conversion_08</Name><USR>c:@C@comment_to_xml_conversion_01@CT>2#T#T@comment_to_xml_conversion_08</USR><Declaration>template <typename T, typename U> class comment_to_xml_conversion_08 {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Class>] + + /// Aaa. + template<typename T> + using comment_to_xml_conversion_09 = comment_to_xml_conversion_08<T, int>; + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:3: UnexposedDecl=comment_to_xml_conversion_09:{{.*}} FullCommentAsXML=[<Typedef file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="3"><Name>comment_to_xml_conversion_09</Name><USR>c:@C@comment_to_xml_conversion_01@comment_to_xml_conversion_09</USR><Declaration>template <typename T>\nusing comment_to_xml_conversion_09 = comment_to_xml_conversion_08<T, int></Declaration><Abstract><Para> Aaa.</Para></Abstract></Typedef>] +}; + +/// Aaa. +template<typename T, typename U> +void comment_to_xml_conversion_10(T aaa, U bbb); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_xml_conversion_10:{{.*}} FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_xml_conversion_10</Name><USR>c:@FT@>2#T#Tcomment_to_xml_conversion_10#t0.0#t0.1#</USR><Declaration>template <typename T, typename U>\nvoid comment_to_xml_conversion_10(T aaa, U bbb)</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] + +/// Aaa. +template<> +void comment_to_xml_conversion_10(int aaa, int bbb); + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_xml_conversion_10:{{.*}} FullCommentAsXML=[<Function templateKind="specialization" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_xml_conversion_10</Name><USR>c:@F@comment_to_xml_conversion_10<#I#I>#I#I#</USR><Declaration>void comment_to_xml_conversion_10(int aaa, int bbb)</Declaration><Abstract><Para> Aaa.</Para></Abstract></Function>] + +/// Aaa. +template<typename T, typename U> +class comment_to_xml_conversion_11 { }; + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:7: ClassTemplate=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[<Class templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="7"><Name>comment_to_xml_conversion_11</Name><USR>c:@CT>2#T#T@comment_to_xml_conversion_11</USR><Declaration>template <typename T, typename U> class comment_to_xml_conversion_11 {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Class>] + +/// Aaa. +template<typename T> +class comment_to_xml_conversion_11<T, int> { }; + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:7: ClassTemplatePartialSpecialization=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[<Class templateKind="partialSpecialization" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="7"><Name>comment_to_xml_conversion_11</Name><USR>c:@CP>1#T@comment_to_xml_conversion_11>#t0.0#I</USR><Declaration>class comment_to_xml_conversion_11 {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Class>] + +/// Aaa. +template<> +class comment_to_xml_conversion_11<int, int> { }; + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:7: ClassDecl=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[<Class templateKind="specialization" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="7"><Name>comment_to_xml_conversion_11</Name><USR>c:@C@comment_to_xml_conversion_11>#I#I</USR><Declaration>class comment_to_xml_conversion_11 {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Class>] + +/// Aaa. +int comment_to_xml_conversion_12; + +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:5: VarDecl=comment_to_xml_conversion_12:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="5"><Name>comment_to_xml_conversion_12</Name><USR>c:@comment_to_xml_conversion_12</USR><Declaration>int comment_to_xml_conversion_12</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] + +/// Aaa. +namespace comment_to_xml_conversion_13 { +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:11: Namespace=comment_to_xml_conversion_13:{{.*}} FullCommentAsXML=[<Namespace file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="11"><Name>comment_to_xml_conversion_13</Name><USR>c:@N@comment_to_xml_conversion_13</USR><Declaration>namespace comment_to_xml_conversion_13 {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Namespace>] + + /// Aaa. + namespace comment_to_xml_conversion_14 { +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:13: Namespace=comment_to_xml_conversion_14:{{.*}} FullCommentAsXML=[<Namespace file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="13"><Name>comment_to_xml_conversion_14</Name><USR>c:@N@comment_to_xml_conversion_13@N@comment_to_xml_conversion_14</USR><Declaration>namespace comment_to_xml_conversion_14 {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Namespace>] + } +} + +/// Aaa. +enum comment_to_xml_conversion_15 { +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: EnumDecl=comment_to_xml_conversion_15:{{.*}} FullCommentAsXML=[<Enum file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_15</Name><USR>c:@E@comment_to_xml_conversion_15</USR><Declaration>enum comment_to_xml_conversion_15{{( : int)?}} {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Enum>] + + /// Aaa. + comment_to_xml_conversion_16 +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:3: EnumConstantDecl=comment_to_xml_conversion_16:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="3"><Name>comment_to_xml_conversion_16</Name><USR>c:@E@comment_to_xml_conversion_15@comment_to_xml_conversion_16</USR><Declaration>comment_to_xml_conversion_16</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] +}; + +/// Aaa. +enum class comment_to_xml_conversion_17 { +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:12: EnumDecl=comment_to_xml_conversion_17:{{.*}} FullCommentAsXML=[<Enum file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="12"><Name>comment_to_xml_conversion_17</Name><USR>c:@E@comment_to_xml_conversion_17</USR><Declaration>enum class comment_to_xml_conversion_17 : int {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Enum>] + + /// Aaa. + comment_to_xml_conversion_18 +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:3: EnumConstantDecl=comment_to_xml_conversion_18:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="3"><Name>comment_to_xml_conversion_18</Name><USR>c:@E@comment_to_xml_conversion_17@comment_to_xml_conversion_18</USR><Declaration>comment_to_xml_conversion_18</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>] +}; + +/// Aaa. +/// \todo Bbb. +void comment_to_xml_conversion_todo_1(); +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_todo_1:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_todo_1</Name><USR>c:@F@comment_to_xml_conversion_todo_1#</USR><Declaration>void comment_to_xml_conversion_todo_1()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Discussion><Para kind="todo"> Bbb.</Para></Discussion></Function>] + +/// Aaa. +/// \todo Bbb. +/// +/// Ccc. +void comment_to_xml_conversion_todo_2(); +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_todo_2:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_todo_2</Name><USR>c:@F@comment_to_xml_conversion_todo_2#</USR><Declaration>void comment_to_xml_conversion_todo_2()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Discussion><Para kind="todo"> Bbb.</Para><Para> Ccc.</Para></Discussion></Function>] + +/// Aaa. +/// \todo Bbb. +/// +/// Ccc. +/// \todo Ddd. +void comment_to_xml_conversion_todo_3(); +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_todo_3:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_todo_3</Name><USR>c:@F@comment_to_xml_conversion_todo_3#</USR><Declaration>void comment_to_xml_conversion_todo_3()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Discussion><Para kind="todo"> Bbb.</Para><Para> Ccc. </Para><Para kind="todo"> Ddd.</Para></Discussion></Function>] + +/// Aaa. +/// \todo Bbb. +/// \todo Ccc. +void comment_to_xml_conversion_todo_4(); +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_todo_4:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_todo_4</Name><USR>c:@F@comment_to_xml_conversion_todo_4#</USR><Declaration>void comment_to_xml_conversion_todo_4()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Discussion><Para kind="todo"> Bbb. </Para><Para kind="todo"> Ccc.</Para></Discussion></Function>] + +#endif + diff --git a/test/Index/comment-xml-schema.c b/test/Index/comment-xml-schema.c index 91ea7b2..b8560f7 100644 --- a/test/Index/comment-xml-schema.c +++ b/test/Index/comment-xml-schema.c @@ -30,6 +30,8 @@ // RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-typedef-02.xml // // RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-enum-01.xml +// +// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-para-kind-01.xml // RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-01.xml 2>&1 | FileCheck %s -check-prefix=INVALID // RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-02.xml 2>&1 | FileCheck %s -check-prefix=INVALID @@ -43,6 +45,9 @@ // RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-10.xml 2>&1 | FileCheck %s -check-prefix=INVALID // RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-11.xml 2>&1 | FileCheck %s -check-prefix=INVALID // RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-12.xml 2>&1 | FileCheck %s -check-prefix=INVALID +// +// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-para-kind-01.xml 2>&1 | FileCheck %s -check-prefix=INVALID +// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-para-kind-02.xml 2>&1 | FileCheck %s -check-prefix=INVALID // CHECK-INVALID: fails to validate diff --git a/test/Index/complete-declarators.m b/test/Index/complete-declarators.m index 071df60..b3a60de 100644 --- a/test/Index/complete-declarators.m +++ b/test/Index/complete-declarators.m @@ -22,8 +22,20 @@ static P *p = 0; } +- (boid)method2 {} @end +// RUN: c-index-test -code-completion-at=%s:7:4 %s | FileCheck -check-prefix=CHECK-CC0 %s +// CHECK-CC0: NotImplemented:{TypedText IBAction}{RightParen )}{Placeholder selector}{Colon :}{LeftParen (}{Text id}{RightParen )}{Text sender} (40) +// CHECK-CC0: macro definition:{TypedText IBAction} (70) +// CHECK-CC0: macro definition:{TypedText IBOutlet} (70) +// CHECK-CC0: macro definition:{TypedText IBOutletCollection}{LeftParen (}{Placeholder ClassName}{RightParen )} (70) +// CHECK-CC0: TypedefDecl:{TypedText id} (50) +// CHECK-CC0: NotImplemented:{TypedText in} (40) +// CHECK-CC0: NotImplemented:{TypedText inout} (40) +// CHECK-CC0: NotImplemented:{TypedText instancetype} (40) +// CHECK-CC0: NotImplemented:{TypedText int} (50) +// CHECK-CC0: NotImplemented:{TypedText long} (50) // RUN: c-index-test -code-completion-at=%s:7:19 %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1-NOT: NotImplemented:{TypedText extern} (40) // CHECK-CC1: NotImplemented:{TypedText param1} (40) @@ -70,3 +82,8 @@ // CHECK-CC5: NotImplemented:{TypedText unsigned} (50) // CHECK-CC5: NotImplemented:{TypedText void} (50) // CHECK-CC5: NotImplemented:{TypedText volatile} (50) + +// Check that there are no duplicate entries if we code-complete after an @implementation +// RUN: c-index-test -code-completion-at=%s:27:1 %s | FileCheck -check-prefix=CHECK-CC6 %s +// CHECK-CC6: ObjCInterfaceDecl:{TypedText A} +// CHECK-CC6-NOT: ObjCInterfaceDecl:{TypedText A} diff --git a/test/Index/complete-documentation-properties.m b/test/Index/complete-documentation-properties.m new file mode 100644 index 0000000..774a020 --- /dev/null +++ b/test/Index/complete-documentation-properties.m @@ -0,0 +1,92 @@ +// Note: the run lines follow their respective tests, since line/column numbers +// matter in this test. +// This test is for when property accessors do not have their own code +// completion comments. Use those in their properties in this case. +// rdar://12791315 + +@interface AppDelegate +/** + \brief This is ReadonlyProperty +*/ +@property (readonly, getter = ReadonlyGetter) id MyProperty; + +/** + \brief This is GeneralProperty +*/ +@property int GeneralProperty; + +/** + \brief This is PropertyInPrimaryClass +*/ +@property (copy, nonatomic) id PropertyInPrimaryClass; + +- (void) setThisRecord : (id)arg; +- (id) Record; +@end + + +@interface AppDelegate() +- (id) GetterInClassExtension; +/** + \brief This is Record +*/ +@property (copy, setter = setThisRecord:) id Record; +@end + +@interface AppDelegate() +/** + \brief This is PropertyInClassExtension +*/ +@property (copy, getter = GetterInClassExtension) id PropertyInClassExtension; + +- (id) PropertyInPrimaryClass; +@end + +@implementation AppDelegate +- (id) PropertyInPrimaryClass { + id p = [self ReadonlyGetter]; + p = [self GetterInClassExtension]; + p = [self PropertyInPrimaryClass]; + p = [self Record]; + [self setThisRecord : (id)0 ]; + p = self.GetterInClassExtension; + return 0; +} +@end +// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:47:16 %s | FileCheck -check-prefix=CC1 %s +// CHECK-CC1: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is ReadonlyProperty) + +// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:48:13 %s | FileCheck -check-prefix=CC2 %s +// CHECK-CC2: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension) + +// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:49:13 %s | FileCheck -check-prefix=CC3 %s +// CHECK-CC3: {TypedText PropertyInPrimaryClass}{{.*}}(brief comment: This is PropertyInPrimaryClass) + +// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:50:13 %s | FileCheck -check-prefix=CC4 %s +// CHECK-CC4: {TypedText Record}{{.*}}(brief comment: This is Record) + +// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:51:9 %s | FileCheck -check-prefix=CC5 %s +// CHECK-CC5: {TypedText setThisRecord:}{Placeholder (id)}{{.*}}(brief comment: This is Record) + +// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:52:12 %s | FileCheck -check-prefix=CC6 %s +// CHECK-CC6: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension) + +@interface AnotherAppDelegate +/** + \brief This is ReadonlyProperty +*/ +@property (getter = ReadonlyGetter) int MyProperty; +/** + \brief This is getter = ReadonlyGetter +*/ +- (int) ReadonlyGetter; +@end + +@implementation AnotherAppDelegate +- (int) PropertyInPrimaryClass { +self.ReadonlyGetter; +} +@end +// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:87:6 %s | FileCheck -check-prefix=CC7 %s +// CHECK-CC7: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is getter = ReadonlyGetter) + diff --git a/test/Index/complete-driver-errors.c b/test/Index/complete-driver-errors.c deleted file mode 100644 index 566090c..0000000 --- a/test/Index/complete-driver-errors.c +++ /dev/null @@ -1,24 +0,0 @@ -int *blah = 1; - -int - -// CHECK-RESULTS: NotImplemented:{TypedText const} (40) -// CHECK-RESULTS: NotImplemented:{TypedText restrict} (40) -// CHECK-RESULTS: NotImplemented:{TypedText volatile} (40) -// CHECK-DIAGS: error: invalid value '' in '-std=' -// CHECK-DIAGS: complete-driver-errors.c:1:6:{1:13-1:14}: warning: incompatible integer to pointer conversion initializing 'int *' with an expression of type 'int' - -// Test driver errors with code completion -// RUN: c-index-test -code-completion-at=%s:4:1 -std= %s 2> %t | FileCheck -check-prefix=CHECK-RESULTS %s -// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t - -// Test driver errors with parsing -// RUN: c-index-test -test-load-source all -std= %s 2> %t | FileCheck -check-prefix=CHECK-LOAD %s -// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t -// CHECK-LOAD: complete-driver-errors.c:1:6: VarDecl=blah:1:6 - -// Test driver errors with code completion and precompiled preamble -// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:4:1 -std= %s 2> %t | FileCheck -check-prefix=CHECK-RESULTS %s -// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t -// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source all -std= %s 2> %t | FileCheck -check-prefix=CHECK-LOAD %s -// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t diff --git a/test/Index/complete-exprs.c b/test/Index/complete-exprs.c index afb6219..bace067 100644 --- a/test/Index/complete-exprs.c +++ b/test/Index/complete-exprs.c @@ -66,4 +66,4 @@ void f5(float f) { // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (50) // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f4}{LeftParen (}{Placeholder const char *str}{RightParen )} (50) // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f5}{LeftParen (}{Placeholder float f}{RightParen )} (50) -// CHECK-CC7: TypedefDecl:{TypedText type} +// CHECK-CC7: TypedefDecl:{TypedText type} (50) diff --git a/test/Index/complete-lambdas.mm b/test/Index/complete-lambdas.mm index 68f2b6b..049dc1d 100644 --- a/test/Index/complete-lambdas.mm +++ b/test/Index/complete-lambdas.mm @@ -42,7 +42,7 @@ // RUN: c-index-test -code-completion-at=%s:18:10 -x objective-c++ -std=c++11 %s | FileCheck -check-prefix=CHECK-CC1 %s // RUN: c-index-test -code-completion-at=%s:19:8 -x objective-c++ -std=c++11 %s | FileCheck -check-prefix=CHECK-CC5 %s -// CHECK-CC5: NotImplemented:{ResultType SEL}{TypedText _cmd} (80) +// CHECK-CC5: NotImplemented:{ResultType SEL}{TypedText _cmd} (34) // CHECK-CC5-NEXT: NotImplemented:{ResultType B *}{TypedText self} (34) // RUN: c-index-test -code-completion-at=%s:20:11 -x objective-c++ -std=c++11 %s | FileCheck -check-prefix=CHECK-CC6 %s diff --git a/test/Index/complete-macro-args.c b/test/Index/complete-macro-args.c index ca36af1..2507984 100644 --- a/test/Index/complete-macro-args.c +++ b/test/Index/complete-macro-args.c @@ -12,11 +12,47 @@ void test(struct Point *p) { MACRO(p->x); } +#define MACRO3(x,y,z) x;y;z + +void test2(struct Point *p) { + MACRO3(p->x); + MACRO3(p->x +} + +#define FM(x) x +void test3(struct Point *p) { + FM(p->x, a); +} + +#define VGM(...) 0 +#define VGM2(...) __VA_ARGS__ + +// These need to be last, to test proper handling of EOF. +#ifdef EOF_TEST1 +void test3(struct Point *p) { + VGM(1,2, p->x + +#elif EOF_TEST2 +void test3(struct Point *p) { + VGM2(VGM(1,2, p->x + +#endif + // RUN: c-index-test -code-completion-at=%s:11:12 %s | FileCheck %s // RUN: c-index-test -code-completion-at=%s:12:12 %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:18:13 %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:19:13 %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:24:9 %s | FileCheck %s // CHECK: FieldDecl:{ResultType float}{TypedText x} (35) // CHECK-NEXT: FieldDecl:{ResultType float}{TypedText y} (35) // CHECK-NEXT: FieldDecl:{ResultType float}{TypedText z} (35) // CHECK-NEXT: Completion contexts: // CHECK-NEXT: Arrow member access // CHECK-NEXT: Container Kind: StructDecl + +// With these, code-completion is unknown because the macro argument (and the +// completion point) is not expanded by the macro definition. +// RUN: c-index-test -code-completion-at=%s:33:15 %s -DEOF_TEST1 | FileCheck %s -check-prefix=CHECK-EOF +// RUN: c-index-test -code-completion-at=%s:37:20 %s -DEOF_TEST2 | FileCheck %s -check-prefix=CHECK-EOF +// CHECK-EOF: Completion contexts: +// CHECK-EOF: Unknown diff --git a/test/Index/complete-modules.m b/test/Index/complete-modules.m index b82430d..d63c4b8 100644 --- a/test/Index/complete-modules.m +++ b/test/Index/complete-modules.m @@ -1,14 +1,17 @@ // Note: the run lines follow their respective tests, since line/column // matter in this test. -@__experimental_modules_import LibA.Extensions; +@import LibA.Extensions; // RUN: rm -rf %t -// RUN: c-index-test -code-completion-at=%s:4:32 -fmodule-cache-path %t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP-LEVEL %s +// RUN: c-index-test -code-completion-at=%s:4:9 -fmodules-cache-path=%t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP-LEVEL %s // CHECK-TOP-LEVEL: NotImplemented:{TypedText Framework} (50) // CHECK-TOP-LEVEL: NotImplemented:{TypedText LibA} (50) // CHECK-TOP-LEVEL: NotImplemented:{TypedText nested} (50) -// RUN: c-index-test -code-completion-at=%s:4:37 -fmodule-cache-path %t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-LIBA %s +// RUN: c-index-test -code-completion-at=%s:4:14 -fmodules-cache-path=%t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-LIBA %s // CHECK-LIBA: NotImplemented:{TypedText Extensions} (50) +// RUN: c-index-test -code-completion-at=%s:4:1 -fmodules-cache-path=%t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP %s +// CHECK-TOP: NotImplemented:{TypedText @import}{HorizontalSpace }{Placeholder module} (40) + diff --git a/test/Index/complete-objc-message.m b/test/Index/complete-objc-message.m index aa10ea2..5a72005 100644 --- a/test/Index/complete-objc-message.m +++ b/test/Index/complete-objc-message.m @@ -193,6 +193,7 @@ void test_DO(DO *d, A* a) { // CHECK-CC1: {TypedText categoryClassMethod} (35) // CHECK-CC1: {TypedText classMethod1:}{Placeholder (id)}{HorizontalSpace }{TypedText withKeyword:}{Placeholder (int)} (35) // CHECK-CC1: {TypedText classMethod2} (35) +// CHECK-CC1: {TypedText instanceMethod1} (35) // CHECK-CC1: {TypedText new} (35) // CHECK-CC1: {TypedText protocolClassMethod} (37) // CHECK-CC1: Completion contexts: @@ -238,15 +239,15 @@ void test_DO(DO *d, A* a) { // CHECK-CC9: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{Informative Arg1:}{TypedText OtherArg:}{Placeholder (id)} // CHECK-CC9: Objective-C selector: Method:Arg1: // RUN: c-index-test -code-completion-at=%s:61:11 %s | FileCheck -check-prefix=CHECK-CCA %s -// CHECK-CCA: TypedefDecl:{TypedText Class} -// CHECK-CCA-NEXT: ObjCInterfaceDecl:{TypedText Foo} -// CHECK-CCA-NOT: FunctionDecl:{ResultType void}{TypedText func}{LeftParen (}{RightParen )} -// CHECK-CCA:FunctionDecl:{ResultType MyClass *}{TypedText getMyClass}{LeftParen (}{RightParen )} -// CHECK-CCA: TypedefDecl:{TypedText id} -// CHECK-CCA: ObjCInterfaceDecl:{TypedText MyClass} -// CHECK-CCA: ObjCInterfaceDecl:{TypedText MySubClass} -// CHECK-CCA: {ResultType Class}{TypedText self} -// CHECK-CCA: {TypedText super} +// CHECK-CCA: TypedefDecl:{TypedText Class} (50) +// CHECK-CCA-NEXT: ObjCInterfaceDecl:{TypedText Foo} (50) +// CHECK-CCA-NOT: FunctionDecl:{ResultType void}{TypedText func}{LeftParen (}{RightParen )} (50) +// CHECK-CCA:FunctionDecl:{ResultType MyClass *}{TypedText getMyClass}{LeftParen (}{RightParen )} (50) +// CHECK-CCA: TypedefDecl:{TypedText id} (50) +// CHECK-CCA: ObjCInterfaceDecl:{TypedText MyClass} (50) +// CHECK-CCA: ObjCInterfaceDecl:{TypedText MySubClass} (50) +// CHECK-CCA: {ResultType Class}{TypedText self} (34) +// CHECK-CCA: {TypedText super} (40) // RUN: c-index-test -code-completion-at=%s:103:6 %s | FileCheck -check-prefix=CHECK-CCB %s // CHECK-CCB: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (int), ...} // CHECK-CCB: ObjCInstanceMethodDecl:{ResultType int}{TypedText SentinelMethod:}{Placeholder (int), ...}{Text , nil} diff --git a/test/Index/complete-stmt.c b/test/Index/complete-stmt.c index e39431e..3d31ca2 100644 --- a/test/Index/complete-stmt.c +++ b/test/Index/complete-stmt.c @@ -1,7 +1,7 @@ // Note: the run lines follow their respective tests, since line/column // matter in this test. - +typedef int Integer; void f(int x) { if (x) { } @@ -14,3 +14,12 @@ void f(int x) { // RUN: c-index-test -code-completion-at=%s:7:4 %s | FileCheck -check-prefix=CHECK-IF-ELSE-SIMPLE %s // CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else} (40) // CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else}{HorizontalSpace }{Text if}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )} (40) + +// RUN: c-index-test -code-completion-at=%s:6:1 %s | FileCheck -check-prefix=CHECK-STMT %s +// CHECK-STMT: NotImplemented:{TypedText char} (50) +// CHECK-STMT: NotImplemented:{TypedText const} (50) +// CHECK-STMT: NotImplemented:{TypedText double} (50) +// CHECK-STMT: NotImplemented:{TypedText enum} (50) +// CHECK-STMT: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder int x}{RightParen )} (50) +// CHECK-STMT: TypedefDecl:{TypedText Integer} (50) +// CHECK-STMT: ParmDecl:{ResultType int}{TypedText x} (34) diff --git a/test/Index/complete-super.m b/test/Index/complete-super.m index 6c2daa8..be7edfd 100644 --- a/test/Index/complete-super.m +++ b/test/Index/complete-super.m @@ -53,8 +53,7 @@ typedef int Bool; // CHECK-ADD-ADD: ObjCInstanceMethodDecl:{ResultType void}{TypedText last} (35) // RUN: c-index-test -code-completion-at=%s:24:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s -// CHECK-SELECTOR-SELECTOR-NOT: x -// CHECK-SELECTOR-SELECTOR: ObjCClassMethodDecl:{ResultType void}{TypedText last} (35) +// CHECK-SELECTOR-SELECTOR: ObjCInstanceMethodDecl:{ResultType void}{TypedText last} (35) // CHECK-SELECTOR-SELECTOR: ObjCClassMethodDecl:{ResultType void}{TypedText select:}{Placeholder condition}{HorizontalSpace }{Text first:}{Placeholder a}{HorizontalSpace }{Text second:}{Placeholder b} (20) // Check "super" completion at the second identifier diff --git a/test/Index/crash-recovery-code-complete.c b/test/Index/crash-recovery-code-complete.c index dde90bc..c502ce5 100644 --- a/test/Index/crash-recovery-code-complete.c +++ b/test/Index/crash-recovery-code-complete.c @@ -7,6 +7,8 @@ // CHECK-CODE-COMPLETE-CRASH: Unable to perform code completion! // // REQUIRES: crash-recovery -// REQUIRES: shell + +// FIXME: Please investigate abnormal path in MemoryBuffer. +// XFAIL: mingw32,win32 #warning parsing original file diff --git a/test/Index/crash-recovery-modules.m b/test/Index/crash-recovery-modules.m index 212923f..23740ec 100644 --- a/test/Index/crash-recovery-modules.m +++ b/test/Index/crash-recovery-modules.m @@ -2,18 +2,18 @@ // RUN: rm -rf %t // Parse the file, such that building the module will cause Clang to crash. -// RUN: not env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodule-cache-path %t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DCRASH %s 2> %t.err +// RUN: not env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DCRASH %s 2> %t.err // RUN: FileCheck < %t.err -check-prefix=CHECK-CRASH %s -// CHECK-CRASH: crash-recovery-modules.m:16:32:{16:2-16:37}: fatal error: could not build module 'Crash' +// CHECK-CRASH: crash-recovery-modules.m:16:9:{16:2-16:14}: fatal error: could not build module 'Crash' // Parse the file again, without crashing, to make sure that // subsequent parses do the right thing. -// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodule-cache-path %t -Xclang -fdisable-module-hash -I %S/Inputs/Headers %s +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers %s // REQUIRES: crash-recovery // REQUIRES: shell -@__experimental_modules_import Crash; +@import Crash; void test() { const char* error = getCrashString(); diff --git a/test/Index/crash-recovery-reparse.c b/test/Index/crash-recovery-reparse.c index 06bb76b..e3f7265 100644 --- a/test/Index/crash-recovery-reparse.c +++ b/test/Index/crash-recovery-reparse.c @@ -7,6 +7,5 @@ // CHECK-REPARSE-SOURCE-CRASH: Unable to reparse translation unit // // REQUIRES: crash-recovery -// REQUIRES: shell #warning parsing original file diff --git a/test/Index/file-includes.c b/test/Index/file-includes.c new file mode 100644 index 0000000..2dfced0 --- /dev/null +++ b/test/Index/file-includes.c @@ -0,0 +1,24 @@ + +#include "targeted-top.h" +#include "targeted-preamble.h" + +extern int LocalVar; +int LocalVar; + +// RUN: c-index-test -write-pch %t.h.pch %S/targeted-top.h -Xclang -detailed-preprocessing-record + +// RUN: c-index-test -file-includes-in=%s %s | FileCheck %s -check-prefix=LOCAL +// RUN: env CINDEXTEST_EDITING=1 c-index-test -file-includes-in=%s %s | FileCheck %s -check-prefix=LOCAL +// RUN: c-index-test -file-includes-in=%s %s -include %t.h | FileCheck %s -check-prefix=LOCAL +// RUN: env CINDEXTEST_EDITING=1 c-index-test -file-includes-in=%s %s -include %t.h | FileCheck %s -check-prefix=LOCAL + +// LOCAL: inclusion directive=targeted-top.h ({{.*[/\\]}}test{{[/\\]}}Index{{[/\\]}}targeted-top.h) {{.*}}=[2:1 - 2:2] +// LOCAL: inclusion directive=targeted-preamble.h ({{.*[/\\]}}test{{[/\\]}}Index{{[/\\]}}targeted-preamble.h) =[3:1 - 3:2] + +// RUN: c-index-test -file-includes-in=%S/targeted-top.h %s | FileCheck %s -check-prefix=TOP +// RUN: env CINDEXTEST_EDITING=1 c-index-test -file-includes-in=%S/targeted-top.h %s | FileCheck %s -check-prefix=TOP +// RUN: c-index-test -file-includes-in=%S/targeted-top.h %s -include %t.h | FileCheck %s -check-prefix=TOP +// RUN: env CINDEXTEST_EDITING=1 c-index-test -file-includes-in=%S/targeted-top.h %s -include %t.h | FileCheck %s -check-prefix=TOP + +// TOP: inclusion directive=targeted-nested1.h ({{.*[/\\]}}test{{[/\\]}}Index{{[/\\]}}targeted-nested1.h) =[5:1 - 5:2] +// TOP: inclusion directive=targeted-fields.h ({{.*[/\\]}}test{{[/\\]}}Index{{[/\\]}}targeted-fields.h) =[16:1 - 16:2] diff --git a/test/Index/fix-its.c b/test/Index/fix-its.c index d5cb1af..1e710c2 100644 --- a/test/Index/fix-its.c +++ b/test/Index/fix-its.c @@ -22,6 +22,6 @@ int printf(const char *restrict, ...); void f2() { unsigned long index; // CHECK: warning: format specifies type 'int' but the argument has type 'unsigned long' - // CHECK: FIX-IT: Replace [26:17 - 26:19] with "%ld" + // CHECK: FIX-IT: Replace [26:17 - 26:19] with "%lu" MACRO(printf("%d", index)); } diff --git a/test/Index/fix-its.m b/test/Index/fix-its.m new file mode 100644 index 0000000..b307cf4 --- /dev/null +++ b/test/Index/fix-its.m @@ -0,0 +1,28 @@ +// RUN: c-index-test -test-load-source all %s -Wno-objc-root-class > %t 2>&1 +// RUN: FileCheck -input-file=%t %s + +@class NSString; +void _rdar_12584554_A (volatile const void * object, volatile const void * selector, const char * functionName, const char * fileName, unsigned int lineNumber, NSString * msgFormat, ...); +#define _rdar_12584554_B(self,_format_and_args_...) \ + do{ _rdar_12584554_A(&self,&_cmd,__PRETTY_FUNCTION__,__FILE__,__LINE__, _format_and_args_); }while(0) +#define _rdar_12584554_C(_format_and_args_...) \ + _rdar_12584554_B(self, _format_and_args_) + +@interface RDar12584554 +@end + +// This test case tests that the "@" is properly inserted before the '"', even in the +// presence of a nested macro chain. +@implementation RDar12584554 +- (void) test:(int)result { + _rdar_12584554_C("ted"); +} +@end + +// CHECK: FIX-IT: Insert "@" at 18:22 +// CHECK: fix-its.m:9:28: note: expanded from macro '_rdar_12584554_C' +// CHECK: Number FIX-ITs = 0 +// CHECK: fix-its.m:7:77: note: expanded from macro '_rdar_12584554_B' +// CHECK: Number FIX-ITs = 0 +// CHECK: fix-its.m:5:172: note: passing argument to parameter 'msgFormat' here +// CHECK: Number FIX-ITs = 0 diff --git a/test/Index/format-comment-cdecls.c b/test/Index/format-comment-cdecls.c new file mode 100644 index 0000000..471be2b --- /dev/null +++ b/test/Index/format-comment-cdecls.c @@ -0,0 +1,99 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s \ +// RUN: | FileCheck %s + +/** + * \brief Aaa. +*/ +int global_function(); +// CHECK: <Declaration>int global_function()</Declaration> + +/** + * \param x1 Aaa. +*/ +extern void external_function(int x1); +// CHECK: <Declaration>extern void external_function(int x1)</Declaration> + +/** + * \brief global variable; +*/ +int global_variable; +// CHECK: <Declaration>int global_variable</Declaration> + +/** + * \brief local variable; +*/ +static int static_variable; +// CHECK: <Declaration>static int static_variable</Declaration> + +/** + * \brief external variable +*/ +extern int external_variable; +// CHECK: <Declaration>extern int external_variable</Declaration> + +int global_function() { + /** + * \brief a local variable + */ + int local = 10; + return local; +} +// CHECK: <Declaration>int global_function()</Declaration> +// CHECK: <Declaration>int local = 10</Declaration> + +/** + * \brief initialized decl. +*/ +int initialized_global = 100; +// CHECK: <Declaration>int initialized_global = 100</Declaration> + +/** + * \brief typedef example +*/ +typedef int INT_T; +// CHECK: <Declaration>typedef int INT_T</Declaration> + +/** + * \brief aggregate type example +*/ +struct S { +/** + * \brief iS1; +*/ + int iS1; +/** + * \brief dS1; +*/ + double dS1; +}; +// CHECK: <Declaration>struct S {}</Declaration> +// CHECK: <Declaration>int iS1</Declaration> +// CHECK: <Declaration>double dS1</Declaration> + +/** + * \brief enum e; +*/ +enum e { + One, +/** + * \brief Two; +*/ + Two, + Three +}; +// CHECK: <Declaration>enum e {}</Declaration> +// CHECK: <Declaration>Two</Declaration> + +/** + *\brief block declaration +*/ +int (^Block) (int i, int j); +// CHECK: <Declaration>int (^Block)(int, int)</Declaration> + +/** + *\brief block declaration +*/ +int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; }; +// CHECK: <Declaration>int (^Block1)(int, int) = ^(int i, int j) {}</Declaration> diff --git a/test/Index/getcursor-preamble.h b/test/Index/getcursor-preamble.h new file mode 100644 index 0000000..519e655 --- /dev/null +++ b/test/Index/getcursor-preamble.h @@ -0,0 +1,8 @@ +@interface I { + struct AA { + int x; + } aa; + int var; +} +-(id)foo; +@end diff --git a/test/Index/getcursor-preamble.m b/test/Index/getcursor-preamble.m new file mode 100644 index 0000000..3cc442c --- /dev/null +++ b/test/Index/getcursor-preamble.m @@ -0,0 +1,23 @@ +#include "getcursor-preamble.h" + +// RUN: c-index-test \ +// RUN: -cursor-at=%S/getcursor-preamble.h:2:10 \ +// RUN: -cursor-at=%S/getcursor-preamble.h:3:9 \ +// RUN: -cursor-at=%S/getcursor-preamble.h:4:6 \ +// RUN: -cursor-at=%S/getcursor-preamble.h:5:8 \ +// RUN: -cursor-at=%S/getcursor-preamble.h:7:7 \ +// RUN: %s | FileCheck %s + +// RUN: env CINDEXTEST_EDITING=1 c-index-test \ +// RUN: -cursor-at=%S/getcursor-preamble.h:2:10 \ +// RUN: -cursor-at=%S/getcursor-preamble.h:3:9 \ +// RUN: -cursor-at=%S/getcursor-preamble.h:4:6 \ +// RUN: -cursor-at=%S/getcursor-preamble.h:5:8 \ +// RUN: -cursor-at=%S/getcursor-preamble.h:7:7 \ +// RUN: %s | FileCheck %s + +// CHECK: StructDecl=AA:2:10 +// CHECK: FieldDecl=x:3:9 +// CHECK: ObjCIvarDecl=aa:4:5 +// CHECK: ObjCIvarDecl=var:5:7 +// CHECK: ObjCInstanceMethodDecl=foo:7:6 diff --git a/test/Index/headerfile-comment-to-html.m b/test/Index/headerfile-comment-to-html.m new file mode 100644 index 0000000..8326a90 --- /dev/null +++ b/test/Index/headerfile-comment-to-html.m @@ -0,0 +1,111 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s > %t/out +// RUN: FileCheck %s < %t/out +// rdar://13067629 + +// Ensure that XML we generate is not invalid. +// RUN: FileCheck %s -check-prefix=WRONG < %t/out +// WRONG-NOT: CommentXMLInvalid + +// rdar://12397511 + +/*! + \headerfile Device.h <Foundation/Device.h> + + 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. +*/ +@interface Device +@end +// 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>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Device.h ]) +// CHECK-NEXT: (CXComment_Text Text=[<Foundation]) +// CHECK-NEXT: (CXComment_Text Text=[/Device.h>]))) +// CHECK-NEXT: (CXComment_Paragraph +// 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.])))] + +/*! + \headerfile Sensor.h "Sensor.h" + + \brief This is Sensor on the Device. + Its purpose is not to Sense Device's heat. +*/ + +@interface Sensor +@end +// 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>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Sensor.h "Sensor.h"]))) +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ This is Sensor on the Device.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ Its purpose is not to Sense Device's heat.]))))] + +/*! + \brief Test that headerfile can come after brief. + \headerfile VTDevice.h <VTFoundation/VTDevice.h> + + More property decription goes here. +*/ +@interface VTDevice : Device +@end +// 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>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[brief] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ Test that headerfile can come after brief.] HasTrailingNewline) +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ VTDevice.h ]) +// CHECK-NEXT: (CXComment_Text Text=[<VTFoundation]) +// CHECK-NEXT: (CXComment_Text Text=[/VTDevice.h>]))) +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ More property decription goes here.])))] + +/*! + \headerfile <stdio.h> +*/ +extern void uses_stdio_h(); +// 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>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[<stdio]) +// CHECK-NEXT: (CXComment_Text Text=[.h>]))))] + + +/*! + \headerfile <algorithm> +*/ +extern void uses_argorithm(); +// 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>] +// CHECK-NEXT: CommentAST=[ +// CHECK-NEXT: (CXComment_FullComment +// CHECK-NEXT: (CXComment_Paragraph IsWhitespace +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)) +// CHECK-NEXT: (CXComment_BlockCommand CommandName=[headerfile] +// CHECK-NEXT: (CXComment_Paragraph +// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace) +// CHECK-NEXT: (CXComment_Text Text=[<algorithm]) +// CHECK-NEXT: (CXComment_Text Text=[>]))))] diff --git a/test/Index/index-file.cpp b/test/Index/index-file.cpp index bf2d62c..7634c0d 100644 --- a/test/Index/index-file.cpp +++ b/test/Index/index-file.cpp @@ -1,5 +1,9 @@ using MyTypeAlias = int; +extern "C" { + template < typename T > *Allocate() { } +} + // RUN: c-index-test -index-file %s > %t // RUN: FileCheck %s -input-file=%t diff --git a/test/Index/index-module.m b/test/Index/index-module.m index 0af4e37..77dee98 100644 --- a/test/Index/index-module.m +++ b/test/Index/index-module.m @@ -1,10 +1,10 @@ #include <DependsOnModule/DependsOnModule.h> -@__experimental_modules_import DependsOnModule; +@import DependsOnModule; int glob; // RUN: rm -rf %t.cache -// RUN: c-index-test -index-file %s -fmodule-cache-path %t.cache -fmodules -F %S/../Modules/Inputs \ +// RUN: c-index-test -index-file %s -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \ // RUN: -Xclang -fdisable-module-hash | FileCheck %s // CHECK-NOT: [indexDeclaration] @@ -26,6 +26,7 @@ int glob; // CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_PRIVATE_H:.*/Modules/Inputs/DependsOnModule.framework[/\\]PrivateHeaders[/\\]DependsOnModulePrivate.h]] | {{.*}} | hash loc: <invalid> // CHECK-DMOD-NEXT: [importedASTFile]: {{.*}}.cache{{[/\\]}}Module.pcm | loc: [[DMOD_MODULE_H]]:1:2 | name: "Module" | isImplicit: 1 // CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: depends_on_module_other | {{.*}} | loc: [[DMOD_OTHER_H]]:1:5 +// CHECK-DMOD-NEXT: [importedASTFile]: {{.*}}.cache/DependsOnModule.pcm | loc: {{.*}}SubFramework.h:1:2 | name: "DependsOnModule.SubFramework.Other" | isImplicit: 1 // CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: sub_framework | {{.*}} | loc: [[DMOD_SUB_H]]:2:8 // CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: sub_framework_other | {{.*}} | loc: [[DMOD_SUB_OTHER_H]]:1:9 // CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: depends_on_module_private | {{.*}} | loc: [[DMOD_PRIVATE_H]]:1:5 diff --git a/test/Index/index-pch-with-module.m b/test/Index/index-pch-with-module.m index ebab648..ef0392e 100644 --- a/test/Index/index-pch-with-module.m +++ b/test/Index/index-pch-with-module.m @@ -12,8 +12,8 @@ int glob; #endif // RUN: rm -rf %t.cache -// RUN: c-index-test -write-pch %t.h.pch %s -fmodule-cache-path %t.cache -fmodules -F %S/../Modules/Inputs -Xclang -fdisable-module-hash -// RUN: c-index-test -index-file %s -include %t.h -fmodule-cache-path %t.cache -fmodules -F %S/../Modules/Inputs \ +// RUN: c-index-test -write-pch %t.h.pch %s -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs -Xclang -fdisable-module-hash +// RUN: c-index-test -index-file %s -include %t.h -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \ // RUN: -Xclang -fdisable-module-hash | FileCheck %s // CHECK-NOT: [indexDeclaration] diff --git a/test/Index/index-pch.cpp b/test/Index/index-pch.cpp index c8da7b2..caab2d7 100644 --- a/test/Index/index-pch.cpp +++ b/test/Index/index-pch.cpp @@ -1,6 +1,8 @@ // RUN: c-index-test -write-pch %t.pch -fshort-wchar %s -// RUN: c-index-test -index-tu %t.pch | FileCheck %s +// RUN: env LIBCLANG_NOTHREADS=1 c-index-test -index-tu %t.pch | FileCheck %s +// CHECK: [indexDeclaration]: kind: variable | name: wideStr const wchar_t *wideStr = L"123"; -// CHECK: [indexDeclaration]: kind: variable | name: wideStr +// CHECK: [indexDeclaration]: kind: struct | name: __is_void +struct __is_void {}; diff --git a/test/Index/index-suppress-refs.m b/test/Index/index-suppress-refs.m index 46420ee..caf67ba 100644 --- a/test/Index/index-suppress-refs.m +++ b/test/Index/index-suppress-refs.m @@ -41,4 +41,4 @@ MyInt gx; // CHECK-NEXT: <protocol>: kind: objc-protocol | name: P // CHECK-NEXT: [indexDeclaration]: kind: objc-instance-method | name: meth:: // CHECK-NOT: [indexEntityReference]: kind: objc-class | name: B -// CHECK-NOT: [indexEntityReference]: kind: objc-protocol | name: P
\ No newline at end of file +// CHECK-NOT: [indexEntityReference]: kind: objc-protocol | name: P diff --git a/test/Index/linkage.c b/test/Index/linkage.c index 41a1fbd..ab00659 100644 --- a/test/Index/linkage.c +++ b/test/Index/linkage.c @@ -13,6 +13,12 @@ static int wibble(int); void ena(int (*dio)(int tria)); +static int test2; +void f16(void) { + extern int test2; +} + + // CHECK: EnumDecl=Baz:3:6 (Definition)linkage=External // CHECK: EnumConstantDecl=Qux:3:12 (Definition)linkage=External // CHECK: VarDecl=x:4:5linkage=External @@ -28,3 +34,5 @@ void ena(int (*dio)(int tria)); // CHECK: FunctionDecl=ena:14:6linkage=External // CHECK: ParmDecl=dio:14:16 (Definition)linkage=NoLinkage // CHECK: ParmDecl=tria:14:25 (Definition)linkage=NoLinkage +// CHECK: VarDecl=test2{{.*}}linkage=Internal +// CHECK: VarDecl=test2{{.*}}linkage=Internal diff --git a/test/Index/modules-objc-categories.m b/test/Index/modules-objc-categories.m new file mode 100644 index 0000000..4d0fd26 --- /dev/null +++ b/test/Index/modules-objc-categories.m @@ -0,0 +1,10 @@ +@import category_top; +@import category_left; + +@interface Sub : Foo +- (void)left_sub; +@end + +// RUN: rm -rf %t +// RUN: c-index-test -test-load-source local -fmodules -fmodules-cache-path=%t %s -I%S/../Modules/Inputs | FileCheck %s +// CHECK: modules-objc-categories.m:5:9: ObjCInstanceMethodDecl=left_sub:5:9 [Overrides @2:9] diff --git a/test/Index/overriding-ftemplate-comments.cpp b/test/Index/overriding-ftemplate-comments.cpp index 2c5f539..0bc3c2f 100644 --- a/test/Index/overriding-ftemplate-comments.cpp +++ b/test/Index/overriding-ftemplate-comments.cpp @@ -13,17 +13,29 @@ template<typename T> void comment_to_html_conversion_17(T AAA); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_17#t0.0#</USR><Declaration>template <typename T> void comment_to_html_conversion_17(T AAA)</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>] + template<typename T> void comment_to_html_conversion_17(T PPP); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_17#t0.0#</USR><Declaration>template <typename T> void comment_to_html_conversion_17(T PPP)</Declaration><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>] + +//===----------------------------------------------------------------------===// + /// \tparam BBB Bbb /// \tparam AAA Aaa template<typename AAA, typename BBB> void comment_to_html_conversion_19(AAA aaa, BBB bbb); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@>2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><Declaration>template <typename AAA, typename BBB>\nvoid comment_to_html_conversion_19(AAA aaa, BBB bbb)</Declaration><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>] + template<typename PPP, typename QQQ> void comment_to_html_conversion_19(PPP aaa, QQQ bbb); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@>2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><Declaration>template <typename PPP, typename QQQ>\nvoid comment_to_html_conversion_19(PPP aaa, QQQ bbb)</Declaration><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>] + +//===----------------------------------------------------------------------===// + /// \tparam BBB Bbb /// \tparam UUU Zzz /// \tparam CCC Ccc @@ -31,9 +43,15 @@ void comment_to_html_conversion_19(PPP aaa, QQQ bbb); template<typename AAA, typename BBB, int CCC> void comment_to_html_conversion_20(AAA aaa, BBB bbb); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@>3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><Declaration>template <typename AAA, typename BBB, int CCC>\nvoid comment_to_html_conversion_20(AAA aaa, BBB bbb)</Declaration><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>CCC</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>UUU</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>] + template<typename PPP, typename QQQ, int RRR> void comment_to_html_conversion_20(PPP aaa, QQQ bbb); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@>3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><Declaration>template <typename PPP, typename QQQ, int RRR>\nvoid comment_to_html_conversion_20(PPP aaa, QQQ bbb)</Declaration><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>UUU</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>] + +//===----------------------------------------------------------------------===// + /// \tparam AAA Aaa /// \tparam BBB Bbb /// \tparam CCC Ccc @@ -41,39 +59,28 @@ void comment_to_html_conversion_20(PPP aaa, QQQ bbb); template<template<template<typename CCC> class DDD, class BBB> class AAA> void comment_to_html_conversion_21(); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@>1#t>2#t>1#T#Tcomment_to_html_conversion_21#</USR><Declaration>template <template <template <typename CCC> class DDD, class BBB> class AAA>\nvoid comment_to_html_conversion_21()</Declaration><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>CCC</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>DDD</Name><Discussion><Para> Ddd</Para></Discussion></Parameter></TemplateParameters></Function>] + template<template<template<typename RRR> class SSS, class QQQ> class PPP> void comment_to_html_conversion_21(); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@>1#t>2#t>1#T#Tcomment_to_html_conversion_21#</USR><Declaration>template <template <template <typename RRR> class SSS, class QQQ> class PPP>\nvoid comment_to_html_conversion_21()</Declaration><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>RRR</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>SSS</Name><Discussion><Para> Ddd</Para></Discussion></Parameter></TemplateParameters></Function>] + +//===----------------------------------------------------------------------===// + /// \tparam C1 Ccc 1 /// \tparam AAA Zzz /// \tparam C2 Ccc 2 /// \tparam C3 Ccc 3 /// \tparam C4 Ccc 4 /// \tparam BBB Bbb -template<class C1, template<class C2, template<class C3, class C4> class BBB> class AAA> +template <class C1, template <class C2, template <class C3, class C4> class BBB > class AAA> void comment_to_html_conversion_22(); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@FT@>2#T#t>2#T#t>2#T#Tcomment_to_html_conversion_22#</USR><Declaration>template <class C1, template <class C2, template <class C3, class C4> class BBB>\n class AAA>\nvoid comment_to_html_conversion_22()</Declaration><TemplateParameters><Parameter><Name>C1</Name><Index>0</Index><Discussion><Para> Ccc 1 </Para></Discussion></Parameter><Parameter><Name>AAA</Name><Index>1</Index><Discussion><Para> Zzz </Para></Discussion></Parameter><Parameter><Name>C2</Name><Discussion><Para> Ccc 2 </Para></Discussion></Parameter><Parameter><Name>C3</Name><Discussion><Para> Ccc 3 </Para></Discussion></Parameter><Parameter><Name>C4</Name><Discussion><Para> Ccc 4 </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>] template<class CCC1, template<class CCC2, template<class CCC3, class CCC4> class QQQ> class PPP> void comment_to_html_conversion_22(); -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="14" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_17#t0.0#</USR><Declaration>template <typename T> void comment_to_html_conversion_17(T AAA)</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="17" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_17#t0.0#</USR><Declaration>template <typename T> void comment_to_html_conversion_17(T PPP)</Declaration><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="22" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@>2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><Declaration>template <typename AAA, typename BBB> void comment_to_html_conversion_19(AAA aaa, BBB bbb)</Declaration><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="25" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@>2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><Declaration>template <typename PPP, typename QQQ> void comment_to_html_conversion_19(PPP aaa, QQQ bbb)</Declaration><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="32" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@>3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><Declaration>template <typename AAA, typename BBB, int CCC> void comment_to_html_conversion_20(AAA aaa, BBB bbb)</Declaration><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>CCC</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>UUU</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="35" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@>3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><Declaration>template <typename PPP, typename QQQ, int RRR> void comment_to_html_conversion_20(PPP aaa, QQQ bbb)</Declaration><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>UUU</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="42" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@>1#t>2#t>1#T#Tcomment_to_html_conversion_21#</USR><Declaration>template <template <template <typename CCC> class DDD, class BBB> class AAA> void comment_to_html_conversion_21()</Declaration><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>CCC</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>DDD</Name><Discussion><Para> Ddd</Para></Discussion></Parameter></TemplateParameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="45" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@>1#t>2#t>1#T#Tcomment_to_html_conversion_21#</USR><Declaration>template <template <template <typename RRR> class SSS, class QQQ> class PPP> void comment_to_html_conversion_21()</Declaration><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>RRR</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>SSS</Name><Discussion><Para> Ddd</Para></Discussion></Parameter></TemplateParameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="54" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@FT@>2#T#t>2#T#t>2#T#Tcomment_to_html_conversion_22#</USR><Declaration>template <class C1, template <class C2, template <class C3, class C4> class BBB> class AAA> void comment_to_html_conversion_22()</Declaration><TemplateParameters><Parameter><Name>C1</Name><Index>0</Index><Discussion><Para> Ccc 1 </Para></Discussion></Parameter><Parameter><Name>AAA</Name><Index>1</Index><Discussion><Para> Zzz </Para></Discussion></Parameter><Parameter><Name>C2</Name><Discussion><Para> Ccc 2 </Para></Discussion></Parameter><Parameter><Name>C3</Name><Discussion><Para> Ccc 3 </Para></Discussion></Parameter><Parameter><Name>C4</Name><Discussion><Para> Ccc 4 </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="58" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@FT@>2#T#t>2#T#t>2#T#Tcomment_to_html_conversion_22#</USR><Declaration>template <class CCC1, template <class CCC2, template <class CCC3, class CCC4> class QQQ> class PPP> void comment_to_html_conversion_22()</Declaration><TemplateParameters><Parameter><Name>CCC1</Name><Index>0</Index><Discussion><Para> Ccc 1 </Para></Discussion></Parameter><Parameter><Name>PPP</Name><Index>1</Index><Discussion><Para> Zzz </Para></Discussion></Parameter><Parameter><Name>CCC2</Name><Discussion><Para> Ccc 2 </Para></Discussion></Parameter><Parameter><Name>CCC3</Name><Discussion><Para> Ccc 3 </Para></Discussion></Parameter><Parameter><Name>CCC4</Name><Discussion><Para> Ccc 4 </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>] +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@FT@>2#T#t>2#T#t>2#T#Tcomment_to_html_conversion_22#</USR><Declaration>template <class CCC1, template <class CCC2, template <class CCC3, class CCC4>\n class QQQ> class PPP>\nvoid comment_to_html_conversion_22()</Declaration><TemplateParameters><Parameter><Name>CCC1</Name><Index>0</Index><Discussion><Para> Ccc 1 </Para></Discussion></Parameter><Parameter><Name>PPP</Name><Index>1</Index><Discussion><Para> Zzz </Para></Discussion></Parameter><Parameter><Name>CCC2</Name><Discussion><Para> Ccc 2 </Para></Discussion></Parameter><Parameter><Name>CCC3</Name><Discussion><Para> Ccc 3 </Para></Discussion></Parameter><Parameter><Name>CCC4</Name><Discussion><Para> Ccc 4 </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>] diff --git a/test/Index/overriding-method-comments.mm b/test/Index/overriding-method-comments.mm index e718138..46ead4f 100644 --- a/test/Index/overriding-method-comments.mm +++ b/test/Index/overriding-method-comments.mm @@ -19,6 +19,8 @@ - (void)METH:(id)AAA; @end +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void)METH:(id)AAA;</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>] + @interface Sub : Root @end @@ -26,99 +28,98 @@ - (void)METH:(id)BBB; @end +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void)METH:(id)BBB;</Declaration><Parameters><Parameter><Name>BBB</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>] + @implementation Sub(CAT) - (void)METH:(id)III {} @end +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void)METH:(id)III;</Declaration><Parameters><Parameter><Name>III</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>] + @interface Redec : Root @end @interface Redec() /** - * \param[in] AAA input value - * \param[out] CCC output value is int - * \param[in] BBB 2nd input value is double + * \param[in] AAA input value + * \param[out] CCC output value is int + * \param[in] BBB 2nd input value is double */ - (void)EXT_METH:(id)AAA : (double)BBB : (int)CCC; @end +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Declaration>- (void)EXT_METH:(id)AAA:(double)BBB:(int)CCC;</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double </Para></Discussion></Parameter><Parameter><Name>CCC</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int </Para></Discussion></Parameter></Parameters></Function>] + @implementation Redec - (void)EXT_METH:(id)PPP : (double)QQQ : (int)RRR {} @end +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Declaration>- (void)EXT_METH:(id)PPP:(double)QQQ:(int)RRR;</Declaration><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double </Para></Discussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int </Para></Discussion></Parameter></Parameters></Function>] + struct Base { /// \brief Does something. /// \param AAA argument to foo_pure. virtual void foo_pure(int AAA) = 0; +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="16"><Name>foo_pure</Name><USR>c:@S@Base@F@foo_pure#I#</USR><Declaration>virtual void foo_pure(int AAA) = 0</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to foo_pure.</Para></Discussion></Parameter></Parameters></Function>] + /// \brief Does something. /// \param BBB argument to defined virtual. virtual void foo_inline(int BBB) {} +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="16"><Name>foo_inline</Name><USR>c:@S@Base@F@foo_inline#I#</USR><Declaration>virtual void foo_inline(int BBB)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>BBB</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to defined virtual.</Para></Discussion></Parameter></Parameters></Function>] + /// \brief Does something. /// \param CCC argument to undefined virtual. virtual void foo_outofline(int CCC); + +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="16"><Name>foo_outofline</Name><USR>c:@S@Base@F@foo_outofline#I#</USR><Declaration>virtual void foo_outofline(int CCC)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>CCC</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to undefined virtual.</Para></Discussion></Parameter></Parameters></Function>] }; void Base::foo_outofline(int RRR) {} +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="12"><Name>foo_outofline</Name><USR>c:@S@Base@F@foo_outofline#I#</USR><Declaration>void foo_outofline(int RRR)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>RRR</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to undefined virtual.</Para></Discussion></Parameter></Parameters></Function>] + struct Derived : public Base { virtual void foo_pure(int PPP); +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="16"><Name>foo_pure</Name><USR>c:@S@Base@F@foo_pure#I#</USR><Declaration>virtual void foo_pure(int PPP)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to foo_pure.</Para></Discussion></Parameter></Parameters></Function>] + virtual void foo_inline(int QQQ) {} + +// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="16"><Name>foo_inline</Name><USR>c:@S@Base@F@foo_inline#I#</USR><Declaration>virtual void foo_inline(int QQQ)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>QQQ</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to defined virtual.</Para></Discussion></Parameter></Parameters></Function>] }; /// \brief Does something. /// \param DDD a value. void foo(int DDD); +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="6"><Name>foo</Name><USR>c:@F@foo#I#</USR><Declaration>void foo(int DDD)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>DDD</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> a value.</Para></Discussion></Parameter></Parameters></Function>] + void foo(int SSS) {} +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="6"><Name>foo</Name><USR>c:@F@foo#I#</USR><Declaration>void foo(int SSS)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>SSS</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> a value.</Para></Discussion></Parameter></Parameters></Function>] + /// \brief Does something. -/// \param EEE argument to function decl. +/// \param EEE argument to function decl. void foo1(int EEE); +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="6"><Name>foo1</Name><USR>c:@F@foo1#I#</USR><Declaration>void foo1(int EEE)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>EEE</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to function decl.</Para></Discussion></Parameter></Parameters></Function>] + void foo1(int TTT); +// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="6"><Name>foo1</Name><USR>c:@F@foo1#I#</USR><Declaration>void foo1(int TTT)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>TTT</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to function decl.</Para></Discussion></Parameter></Parameters></Function>] + /// \brief Documentation /// \tparam BBB The type, silly. /// \tparam AAA The type, silly as well. template<typename AAA, typename BBB> void foo(AAA, BBB); +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="6"><Name>foo</Name><USR>c:@FT@>2#T#Tfoo#t0.0#t0.1#</USR><Declaration>template <typename AAA, typename BBB> void foo(AAA, BBB)</Declaration><Abstract><Para> Documentation </Para></Abstract><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> The type, silly as well.</Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Discussion><Para> The type, silly. </Para></Discussion></Parameter></TemplateParameters></Function>] + template<typename PPP, typename QQQ> void foo(PPP, QQQ); -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="19" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void) METH:(id)AAA</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="26" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void) METH:(id)BBB</Declaration><Parameters><Parameter><Name>BBB</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="30" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void) METH:(id)III</Declaration><Parameters><Parameter><Name>III</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="42" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Declaration>- (void) EXT_METH:(id)AAA :(double)BBB :(int)CCC</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double </Para></Discussion></Parameter><Parameter><Name>CCC</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int </Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="46" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Declaration>- (void) EXT_METH:(id)PPP :(double)QQQ :(int)RRR</Declaration><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double </Para></Discussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int </Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="52" column="16"><Name>foo_pure</Name><USR>c:@S@Base@F@foo_pure#I#</USR><Declaration>virtual void foo_pure(int AAA) = 0</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to foo_pure.</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="56" column="16"><Name>foo_inline</Name><USR>c:@S@Base@F@foo_inline#I#</USR><Declaration>virtual void foo_inline(int BBB)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>BBB</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to defined virtual.</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="60" column="16"><Name>foo_outofline</Name><USR>c:@S@Base@F@foo_outofline#I#</USR><Declaration>virtual void foo_outofline(int CCC)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>CCC</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to undefined virtual.</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="63" column="12"><Name>foo_outofline</Name><USR>c:@S@Base@F@foo_outofline#I#</USR><Declaration>void foo_outofline(int RRR)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>RRR</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to undefined virtual.</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="66" column="16"><Name>foo_pure</Name><USR>c:@S@Base@F@foo_pure#I#</USR><Declaration>virtual void foo_pure(int PPP)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to foo_pure.</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="68" column="16"><Name>foo_inline</Name><USR>c:@S@Base@F@foo_inline#I#</USR><Declaration>virtual void foo_inline(int QQQ)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>QQQ</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to defined virtual.</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="73" column="6"><Name>foo</Name><USR>c:@F@foo#I#</USR><Declaration>void foo(int DDD)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>DDD</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> a value.</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="75" column="6"><Name>foo</Name><USR>c:@F@foo#I#</USR><Declaration>void foo(int SSS)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>SSS</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> a value.</Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="79" column="6"><Name>foo1</Name><USR>c:@F@foo1#I#</USR><Declaration>void foo1(int EEE)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>EEE</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to function decl. </Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="81" column="6"><Name>foo1</Name><USR>c:@F@foo1#I#</USR><Declaration>void foo1(int TTT)</Declaration><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>TTT</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to function decl. </Para></Discussion></Parameter></Parameters></Function>] - -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-method-comments.mm" line="87" column="6"><Name>foo</Name><USR>c:@FT@>2#T#Tfoo#t0.0#t0.1#</USR><Declaration>template <typename AAA, typename BBB> void foo(AAA, BBB)</Declaration><Abstract><Para> Documentation </Para></Abstract><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> The type, silly as well.</Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Discussion><Para> The type, silly. </Para></Discussion></Parameter></TemplateParameters></Function>] +// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-2]]" column="6"><Name>foo</Name><USR>c:@FT@>2#T#Tfoo#t0.0#t0.1#</USR><Declaration>template <typename PPP, typename QQQ> void foo(PPP, QQQ)</Declaration><Abstract><Para> Documentation </Para></Abstract><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> The type, silly as well.</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> The type, silly. </Para></Discussion></Parameter></TemplateParameters></Function>] -// CHECK: FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-method-comments.mm" line="90" column="6"><Name>foo</Name><USR>c:@FT@>2#T#Tfoo#t0.0#t0.1#</USR><Declaration>template <typename PPP, typename QQQ> void foo(PPP, QQQ)</Declaration><Abstract><Para> Documentation </Para></Abstract><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> The type, silly as well.</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> The type, silly. </Para></Discussion></Parameter></TemplateParameters></Function>] diff --git a/test/Index/preamble_macro_template.cpp b/test/Index/preamble_macro_template.cpp index ee1b413..20f16b5 100644 --- a/test/Index/preamble_macro_template.cpp +++ b/test/Index/preamble_macro_template.cpp @@ -3,12 +3,12 @@ template void foo(int *); int main() { } // RUN: c-index-test -write-pch %t.pch -fno-delayed-template-parsing -x c++-header %S/Inputs/preamble_macro_template.h -// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -fno-delayed-template-parsing -I %S/Inputs -include %t %s | FileCheck %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -fno-delayed-template-parsing -I %S/Inputs -include %t %s 2>&1 | tee %t.check.txt | FileCheck %s // CHECK: preamble_macro_template.h:4:6: FunctionDecl=foo:4:6 (Definition) [Specialization of foo:4:6] Extent=[4:1 - 6:2] // CHECK: preamble_macro_template.h:4:13: ParmDecl=p:4:13 (Definition) Extent=[4:10 - 4:14] // CHECK: preamble_macro_template.h:4:16: CompoundStmt= Extent=[4:16 - 6:2] // CHECK: preamble_macro_template.h:5:3: CStyleCastExpr= Extent=[5:3 - 5:27] -// CHECK: preamble_macro_template.h:1:21: CXXStaticCastExpr= Extent=[1:21 - 5:27] +// CHECK: preamble_macro_template.h:5:9: CXXStaticCastExpr= Extent=[5:9 - 5:27] // CHECK: preamble_macro_template.h:5:25: UnexposedExpr= Extent=[5:25 - 5:26] // CHECK: preamble_macro_template.h:5:25: IntegerLiteral= Extent=[5:25 - 5:26] // CHECK: preamble_macro_template.cpp:3:5: FunctionDecl=main:3:5 (Definition) Extent=[3:1 - 3:15] diff --git a/test/Index/print-bitwidth.c b/test/Index/print-bitwidth.c new file mode 100644 index 0000000..e9e330a --- /dev/null +++ b/test/Index/print-bitwidth.c @@ -0,0 +1,25 @@ +union S { + unsigned ac : 4; + unsigned : 4; + unsigned clock : 1; + unsigned : 0; + unsigned flag : 1; +}; + +struct X { + unsigned light : 1; + unsigned toaster : 1; + int count; + union S stat; +}; + +// RUN: c-index-test -test-print-bitwidth %s | FileCheck %s +// CHECK: FieldDecl=ac:2:12 (Definition) bitwidth=4 +// CHECK: FieldDecl=:3:3 (Definition) bitwidth=4 +// CHECK: FieldDecl=clock:4:12 (Definition) bitwidth=1 +// CHECK: FieldDecl=:5:3 (Definition) bitwidth=0 +// CHECK: FieldDecl=flag:6:12 (Definition) bitwidth=1 +// CHECK: FieldDecl=light:10:12 (Definition) bitwidth=1 +// CHECK: FieldDecl=toaster:11:12 (Definition) bitwidth=1 +// CHECK-NOT: count +// CHECK-NOT: stat diff --git a/test/Index/print-type.c b/test/Index/print-type.c new file mode 100644 index 0000000..8594994 --- /dev/null +++ b/test/Index/print-type.c @@ -0,0 +1,44 @@ +typedef int FooType; +int *p; +int *f(int *p, char *x, FooType z, int arr[5], void (*fn)(int)) { + fn(*p); + const FooType w = z; + return p + z + arr[3]; +} +typedef double OtherType; +typedef int ArrayType[5]; +int __attribute__((vector_size(16))) x; +typedef int __attribute__((vector_size(16))) int4_t; + +// RUN: c-index-test -test-print-type %s | FileCheck %s +// CHECK: FunctionDecl=f:3:6 (Definition) [type=int *(int *, char *, FooType, int *, void (*)(int))] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int, int *, void (*)(int))] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Typedef] [int *] [Pointer] [void (*)(int)] [Pointer]] [isPOD=0] +// CHECK: ParmDecl=p:3:13 (Definition) [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: ParmDecl=x:3:22 (Definition) [type=char *] [typekind=Pointer] [isPOD=1] +// CHECK: ParmDecl=z:3:33 (Definition) [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: TypeRef=FooType:1:13 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: ParmDecl=arr:3:40 (Definition) [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1] +// CHECK: ParmDecl=fn:3:55 (Definition) [type=void (*)(int)] [typekind=Pointer] [canonicaltype=void (*)(int)] [canonicaltypekind=Pointer] [isPOD=1] +// CHECK: ParmDecl=:3:62 (Definition) [type=int] [typekind=Int] [isPOD=1] +// CHECK: CompoundStmt= [type=] [typekind=Invalid] [isPOD=0] +// CHECK: CallExpr=fn:3:55 [type=void] [typekind=Void] [args= [int] [Int]] [isPOD=0] +// CHECK: DeclRefExpr=fn:3:55 [type=void (*)(int)] [typekind=Pointer] [canonicaltype=void (*)(int)] [canonicaltypekind=Pointer] [isPOD=1] +// CHECK: UnaryOperator= [type=int] [typekind=Int] [isPOD=1] +// CHECK: DeclRefExpr=p:3:13 [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: DeclStmt= [type=] [typekind=Invalid] [isPOD=0] +// CHECK: VarDecl=w:5:17 (Definition) [type=const FooType] [typekind=Typedef] const [canonicaltype=const int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: TypeRef=FooType:1:13 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: DeclRefExpr=z:3:33 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: ReturnStmt= [type=] [typekind=Invalid] [isPOD=0] +// CHECK: BinaryOperator= [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: BinaryOperator= [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: DeclRefExpr=p:3:13 [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: DeclRefExpr=z:3:33 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: ArraySubscriptExpr= [type=int] [typekind=Int] [isPOD=1] +// CHECK: DeclRefExpr=arr:3:40 [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1] +// CHECK: TypedefDecl=OtherType:8:16 (Definition) [type=OtherType] [typekind=Typedef] [canonicaltype=double] [canonicaltypekind=Double] [isPOD=1] +// CHECK: TypedefDecl=ArrayType:9:13 (Definition) [type=ArrayType] [typekind=Typedef] [canonicaltype=int [5]] [canonicaltypekind=ConstantArray] [isPOD=1] +// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1] +// CHECK: VarDecl=x:10:38 [type=__attribute__((__vector_size__(4 * sizeof(int)))) int] [typekind=Vector] [isPOD=1] +// CHECK: TypedefDecl=int4_t:11:46 (Definition) [type=int4_t] [typekind=Typedef] [canonicaltype=__attribute__((__vector_size__(4 * sizeof(int)))) int] [canonicaltypekind=Vector] [isPOD=1] diff --git a/test/Index/print-type.cpp b/test/Index/print-type.cpp new file mode 100644 index 0000000..b99d1cb --- /dev/null +++ b/test/Index/print-type.cpp @@ -0,0 +1,61 @@ +namespace outer { + +template<typename T> +struct Foo { + T t; +}; + +namespace inner { + +struct Bar { + Bar(outer::Foo<bool>* foo) { }; + + typedef int FooType; + int *p; + int *f(int *p, char *x, FooType z) { + const FooType w = z; + return p + z; + } + typedef double OtherType; + typedef int ArrayType[5]; +}; + +} +} + +template <typename T> +T tbar(int); + +// RUN: c-index-test -test-print-type %s | FileCheck %s +// CHECK: Namespace=outer:1:11 (Definition) [type=] [typekind=Invalid] [isPOD=0] +// CHECK: ClassTemplate=Foo:4:8 (Definition) [type=] [typekind=Invalid] [isPOD=0] +// CHECK: TemplateTypeParameter=T:3:19 (Definition) [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0] +// CHECK: FieldDecl=t:5:5 (Definition) [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0] +// CHECK: TypeRef=T:3:19 [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0] +// CHECK: Namespace=inner:8:11 (Definition) [type=] [typekind=Invalid] [isPOD=0] +// CHECK: StructDecl=Bar:10:8 (Definition) [type=outer::inner::Bar] [typekind=Record] [isPOD=0] +// CHECK: CXXConstructor=Bar:11:3 (Definition) [type=void (outer::Foo<bool> *)] [typekind=FunctionProto] [canonicaltype=void (outer::Foo<bool> *)] [canonicaltypekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [args= [outer::Foo<bool> *] [Pointer]] [isPOD=0] +// CHECK: ParmDecl=foo:11:25 (Definition) [type=outer::Foo<bool> *] [typekind=Pointer] [canonicaltype=outer::Foo<bool> *] [canonicaltypekind=Pointer] [isPOD=1] +// CHECK: NamespaceRef=outer:1:11 [type=] [typekind=Invalid] [isPOD=0] +// CHECK: TemplateRef=Foo:4:8 [type=] [typekind=Invalid] [isPOD=0] +// CHECK: CompoundStmt= [type=] [typekind=Invalid] [isPOD=0] +// CHECK: TypedefDecl=FooType:13:15 (Definition) [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: FieldDecl=p:14:8 (Definition) [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: CXXMethod=f:15:8 (Definition) [type=int *(int *, char *, FooType)] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int)] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Typedef]] [isPOD=0] +// CHECK: ParmDecl=p:15:15 (Definition) [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: ParmDecl=x:15:24 (Definition) [type=char *] [typekind=Pointer] [isPOD=1] +// CHECK: ParmDecl=z:15:35 (Definition) [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: TypeRef=FooType:13:15 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: CompoundStmt= [type=] [typekind=Invalid] [isPOD=0] +// CHECK: DeclStmt= [type=] [typekind=Invalid] [isPOD=0] +// CHECK: VarDecl=w:16:19 (Definition) [type=const FooType] [typekind=Typedef] const [canonicaltype=const int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: TypeRef=FooType:13:15 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: DeclRefExpr=z:15:35 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: ReturnStmt= [type=] [typekind=Invalid] [isPOD=0] +// CHECK: BinaryOperator= [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: DeclRefExpr=p:15:15 [type=int *] [typekind=Pointer] [isPOD=1] +// CHECK: DeclRefExpr=z:15:35 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1] +// CHECK: TypedefDecl=OtherType:19:18 (Definition) [type=OtherType] [typekind=Typedef] [canonicaltype=double] [canonicaltypekind=Double] [isPOD=1] +// CHECK: TypedefDecl=ArrayType:20:15 (Definition) [type=ArrayType] [typekind=Typedef] [canonicaltype=int [5]] [canonicaltypekind=ConstantArray] [isPOD=1] +// CHECK: FunctionTemplate=tbar:27:3 [type=T (int)] [typekind=FunctionProto] [canonicaltype=type-parameter-0-0 (int)] [canonicaltypekind=FunctionProto] [resulttype=T] [resulttypekind=Unexposed] [isPOD=0] +// CHECK: TemplateTypeParameter=T:26:20 (Definition) [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0] diff --git a/test/Index/print-type.m b/test/Index/print-type.m new file mode 100644 index 0000000..9325c3f --- /dev/null +++ b/test/Index/print-type.m @@ -0,0 +1,10 @@ +@interface Foo +@property (readonly) id x; +-(int) mymethod; +-(const id) mymethod2:(id)x blah:(Class)y boo:(SEL)z; +@end + +// RUN: c-index-test -test-print-type %s | FileCheck %s +// CHECK: ObjCPropertyDecl=x:2:25 [type=id] [typekind=ObjCId] [canonicaltype=id] [canonicaltypekind=ObjCObjectPointer] [isPOD=1] +// CHECK: ObjCInstanceMethodDecl=mymethod:3:8 [type=] [typekind=Invalid] [resulttype=int] [resulttypekind=Int] [isPOD=0] +// CHECK: ObjCInstanceMethodDecl=mymethod2:blah:boo::4:13 [type=] [typekind=Invalid] [resulttype=const id] [resulttypekind=ObjCId] [args= [id] [ObjCId] [Class] [ObjCClass] [SEL] [ObjCSel]] [isPOD=0] diff --git a/test/Index/print-typekind.c b/test/Index/print-typekind.c deleted file mode 100644 index 294aea7..0000000 --- a/test/Index/print-typekind.c +++ /dev/null @@ -1,28 +0,0 @@ -typedef int FooType; -int *p; -int *f(int *p, char *x, FooType z) { - const FooType w = z; - return p + z; -} -typedef double OtherType; -typedef int ArrayType[5]; - -// RUN: c-index-test -test-print-typekind %s | FileCheck %s -// CHECK: TypedefDecl=FooType:1:13 (Definition) typekind=Typedef [canonical=Int] [isPOD=1] -// CHECK: VarDecl=p:2:6 typekind=Pointer [isPOD=1] -// CHECK: FunctionDecl=f:3:6 (Definition) typekind=FunctionProto [canonical=FunctionProto] [result=Pointer] [args= Pointer Pointer Typedef] [isPOD=0] -// CHECK: ParmDecl=p:3:13 (Definition) typekind=Pointer [isPOD=1] -// CHECK: ParmDecl=x:3:22 (Definition) typekind=Pointer [isPOD=1] -// CHECK: ParmDecl=z:3:33 (Definition) typekind=Typedef [canonical=Int] [isPOD=1] -// CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1] -// CHECK: CompoundStmt= typekind=Invalid [isPOD=0] -// CHECK: DeclStmt= typekind=Invalid [isPOD=0] -// CHECK: VarDecl=w:4:17 (Definition) typekind=Typedef const [canonical=Int] [isPOD=1] -// CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1] -// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1] -// CHECK: ReturnStmt= typekind=Invalid [isPOD=0] -// CHECK: BinaryOperator= typekind=Pointer [isPOD=1] -// CHECK: DeclRefExpr=p:3:13 typekind=Pointer [isPOD=1] -// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1] -// CHECK: TypedefDecl=OtherType:7:16 (Definition) typekind=Typedef [canonical=Double] [isPOD=1] -// CHECK: TypedefDecl=ArrayType:8:13 (Definition) typekind=Typedef [canonical=ConstantArray] [isPOD=1] diff --git a/test/Index/print-typekind.m b/test/Index/print-typekind.m deleted file mode 100644 index 565c5e3..0000000 --- a/test/Index/print-typekind.m +++ /dev/null @@ -1,10 +0,0 @@ -@interface Foo -@property (readonly) id x; --(int) mymethod; --(const id) mymethod2:(id)x blah:(Class)y boo:(SEL)z; -@end - -// RUN: c-index-test -test-print-typekind %s | FileCheck %s -// CHECK: ObjCPropertyDecl=x:2:25 typekind=ObjCId [canonical=ObjCObjectPointer] -// CHECK: ObjCInstanceMethodDecl=mymethod:3:8 typekind=Invalid [result=Int] -// CHECK: ObjCInstanceMethodDecl=mymethod2:blah:boo::4:13 typekind=Invalid [result=ObjCId] [args= ObjCId ObjCClass ObjCSel] diff --git a/test/Index/recursive-cxx-member-calls.cpp b/test/Index/recursive-cxx-member-calls.cpp index 501dc29..2cd8d13 100644 --- a/test/Index/recursive-cxx-member-calls.cpp +++ b/test/Index/recursive-cxx-member-calls.cpp @@ -222,11 +222,11 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Keyword: "int" [7:3 - 7:6] FunctionDecl=memcmp:7:7 // CHECK-tokens: Identifier: "memcmp" [7:7 - 7:13] FunctionDecl=memcmp:7:7 // CHECK-tokens: Punctuation: "(" [7:13 - 7:14] FunctionDecl=memcmp:7:7 -// CHECK-tokens: Keyword: "const" [7:14 - 7:19] FunctionDecl=memcmp:7:7 +// CHECK-tokens: Keyword: "const" [7:14 - 7:19] ParmDecl=:7:26 (Definition) // CHECK-tokens: Keyword: "void" [7:20 - 7:24] ParmDecl=:7:26 (Definition) // CHECK-tokens: Punctuation: "*" [7:25 - 7:26] ParmDecl=:7:26 (Definition) // CHECK-tokens: Punctuation: "," [7:26 - 7:27] ParmDecl=:7:26 (Definition) -// CHECK-tokens: Keyword: "const" [7:28 - 7:33] FunctionDecl=memcmp:7:7 +// CHECK-tokens: Keyword: "const" [7:28 - 7:33] ParmDecl=:7:40 (Definition) // CHECK-tokens: Keyword: "void" [7:34 - 7:38] ParmDecl=:7:40 (Definition) // CHECK-tokens: Punctuation: "*" [7:39 - 7:40] ParmDecl=:7:40 (Definition) // CHECK-tokens: Punctuation: "," [7:40 - 7:41] ParmDecl=:7:40 (Definition) @@ -236,7 +236,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Identifier: "size_t" [8:3 - 8:9] TypeRef=size_t:2:25 // CHECK-tokens: Identifier: "strlen" [8:10 - 8:16] FunctionDecl=strlen:8:10 // CHECK-tokens: Punctuation: "(" [8:16 - 8:17] FunctionDecl=strlen:8:10 -// CHECK-tokens: Keyword: "const" [8:17 - 8:22] FunctionDecl=strlen:8:10 +// CHECK-tokens: Keyword: "const" [8:17 - 8:22] ParmDecl=:8:29 (Definition) // CHECK-tokens: Keyword: "char" [8:23 - 8:27] ParmDecl=:8:29 (Definition) // CHECK-tokens: Punctuation: "*" [8:28 - 8:29] ParmDecl=:8:29 (Definition) // CHECK-tokens: Punctuation: ")" [8:29 - 8:30] ParmDecl=:8:29 (Definition) @@ -397,11 +397,11 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Identifier: "IgnoredAttribute" [31:25 - 31:41] EnumConstantDecl=IgnoredAttribute:31:25 (Definition) // CHECK-tokens: Punctuation: "}" [32:5 - 32:6] EnumDecl=Kind:13:10 (Definition) // CHECK-tokens: Punctuation: ";" [32:6 - 32:7] ClassDecl=AttributeList:12:9 (Definition) -// CHECK-tokens: Keyword: "static" [33:5 - 33:11] ClassDecl=AttributeList:12:9 (Definition) +// CHECK-tokens: Keyword: "static" [33:5 - 33:11] CXXMethod=getKind:33:17 (static) // CHECK-tokens: Identifier: "Kind" [33:12 - 33:16] TypeRef=enum clang::AttributeList::Kind:13:10 // CHECK-tokens: Identifier: "getKind" [33:17 - 33:24] CXXMethod=getKind:33:17 (static) // CHECK-tokens: Punctuation: "(" [33:24 - 33:25] CXXMethod=getKind:33:17 (static) -// CHECK-tokens: Keyword: "const" [33:25 - 33:30] CXXMethod=getKind:33:17 (static) +// CHECK-tokens: Keyword: "const" [33:25 - 33:30] ParmDecl=Name:33:48 (Definition) // CHECK-tokens: Identifier: "IdentifierInfo" [33:31 - 33:45] TypeRef=class clang::IdentifierInfo:66:7 // CHECK-tokens: Punctuation: "*" [33:46 - 33:47] ParmDecl=Name:33:48 (Definition) // CHECK-tokens: Identifier: "Name" [33:48 - 33:52] ParmDecl=Name:33:48 (Definition) @@ -413,7 +413,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Identifier: "size_t" [36:1 - 36:7] TypeRef=size_t:2:25 // CHECK-tokens: Identifier: "magic_length" [36:8 - 36:20] FunctionDecl=magic_length:36:8 // CHECK-tokens: Punctuation: "(" [36:20 - 36:21] FunctionDecl=magic_length:36:8 -// CHECK-tokens: Keyword: "const" [36:21 - 36:26] FunctionDecl=magic_length:36:8 +// CHECK-tokens: Keyword: "const" [36:21 - 36:26] ParmDecl=s:36:33 (Definition) // CHECK-tokens: Keyword: "char" [36:27 - 36:31] ParmDecl=s:36:33 (Definition) // CHECK-tokens: Punctuation: "*" [36:32 - 36:33] ParmDecl=s:36:33 (Definition) // CHECK-tokens: Identifier: "s" [36:33 - 36:34] ParmDecl=s:36:33 (Definition) @@ -427,14 +427,14 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: "{" [38:17 - 38:18] ClassDecl=StringRef:38:7 (Definition) // CHECK-tokens: Keyword: "public" [39:1 - 39:7] CXXAccessSpecifier=:39:1 (Definition) // CHECK-tokens: Punctuation: ":" [39:7 - 39:8] CXXAccessSpecifier=:39:1 (Definition) -// CHECK-tokens: Keyword: "typedef" [40:3 - 40:10] ClassDecl=StringRef:38:7 (Definition) -// CHECK-tokens: Keyword: "const" [40:11 - 40:16] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "typedef" [40:3 - 40:10] TypedefDecl=iterator:40:23 (Definition) +// CHECK-tokens: Keyword: "const" [40:11 - 40:16] TypedefDecl=iterator:40:23 (Definition) // CHECK-tokens: Keyword: "char" [40:17 - 40:21] TypedefDecl=iterator:40:23 (Definition) // CHECK-tokens: Punctuation: "*" [40:22 - 40:23] TypedefDecl=iterator:40:23 (Definition) // CHECK-tokens: Identifier: "iterator" [40:23 - 40:31] TypedefDecl=iterator:40:23 (Definition) // CHECK-tokens: Punctuation: ";" [40:31 - 40:32] ClassDecl=StringRef:38:7 (Definition) -// CHECK-tokens: Keyword: "static" [41:3 - 41:9] ClassDecl=StringRef:38:7 (Definition) -// CHECK-tokens: Keyword: "const" [41:10 - 41:15] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "static" [41:3 - 41:9] VarDecl=npos:41:23 +// CHECK-tokens: Keyword: "const" [41:10 - 41:15] VarDecl=npos:41:23 // CHECK-tokens: Identifier: "size_t" [41:16 - 41:22] TypeRef=size_t:2:25 // CHECK-tokens: Identifier: "npos" [41:23 - 41:27] VarDecl=npos:41:23 // CHECK-tokens: Punctuation: "=" [41:28 - 41:29] VarDecl=npos:41:23 @@ -446,7 +446,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: ";" [41:40 - 41:41] ClassDecl=StringRef:38:7 (Definition) // CHECK-tokens: Keyword: "private" [42:1 - 42:8] CXXAccessSpecifier=:42:1 (Definition) // CHECK-tokens: Punctuation: ":" [42:8 - 42:9] CXXAccessSpecifier=:42:1 (Definition) -// CHECK-tokens: Keyword: "const" [43:3 - 43:8] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "const" [43:3 - 43:8] FieldDecl=Data:43:15 (Definition) // CHECK-tokens: Keyword: "char" [43:9 - 43:13] FieldDecl=Data:43:15 (Definition) // CHECK-tokens: Punctuation: "*" [43:14 - 43:15] FieldDecl=Data:43:15 (Definition) // CHECK-tokens: Identifier: "Data" [43:15 - 43:19] FieldDecl=Data:43:15 (Definition) @@ -454,7 +454,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Identifier: "size_t" [44:3 - 44:9] TypeRef=size_t:2:25 // CHECK-tokens: Identifier: "Length" [44:10 - 44:16] FieldDecl=Length:44:10 (Definition) // CHECK-tokens: Punctuation: ";" [44:16 - 44:17] ClassDecl=StringRef:38:7 (Definition) -// CHECK-tokens: Keyword: "static" [45:3 - 45:9] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "static" [45:3 - 45:9] CXXMethod=min:45:17 (Definition) (static) // CHECK-tokens: Identifier: "size_t" [45:10 - 45:16] TypeRef=size_t:2:25 // CHECK-tokens: Identifier: "min" [45:17 - 45:20] CXXMethod=min:45:17 (Definition) (static) // CHECK-tokens: Punctuation: "(" [45:20 - 45:21] CXXMethod=min:45:17 (Definition) (static) @@ -494,7 +494,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: "}" [47:36 - 47:37] CompoundStmt= // CHECK-tokens: Identifier: "StringRef" [48:3 - 48:12] CXXConstructor=StringRef:48:3 (Definition) // CHECK-tokens: Punctuation: "(" [48:12 - 48:13] CXXConstructor=StringRef:48:3 (Definition) -// CHECK-tokens: Keyword: "const" [48:13 - 48:18] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Keyword: "const" [48:13 - 48:18] ParmDecl=Str:48:25 (Definition) // CHECK-tokens: Keyword: "char" [48:19 - 48:23] ParmDecl=Str:48:25 (Definition) // CHECK-tokens: Punctuation: "*" [48:24 - 48:25] ParmDecl=Str:48:25 (Definition) // CHECK-tokens: Identifier: "Str" [48:25 - 48:28] ParmDecl=Str:48:25 (Definition) @@ -516,7 +516,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: "}" [48:70 - 48:71] CompoundStmt= // CHECK-tokens: Identifier: "StringRef" [49:3 - 49:12] CXXConstructor=StringRef:49:3 (Definition) // CHECK-tokens: Punctuation: "(" [49:12 - 49:13] CXXConstructor=StringRef:49:3 (Definition) -// CHECK-tokens: Keyword: "const" [49:13 - 49:18] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Keyword: "const" [49:13 - 49:18] ParmDecl=data:49:25 (Definition) // CHECK-tokens: Keyword: "char" [49:19 - 49:23] ParmDecl=data:49:25 (Definition) // CHECK-tokens: Punctuation: "*" [49:24 - 49:25] ParmDecl=data:49:25 (Definition) // CHECK-tokens: Identifier: "data" [49:25 - 49:29] ParmDecl=data:49:25 (Definition) @@ -670,7 +670,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: "(" [67:22 - 67:23] CXXConstructor=IdentifierInfo:67:8 // CHECK-tokens: Punctuation: ")" [67:23 - 67:24] CXXConstructor=IdentifierInfo:67:8 // CHECK-tokens: Punctuation: ";" [67:24 - 67:25] ClassDecl=IdentifierInfo:66:7 (Definition) -// CHECK-tokens: Keyword: "const" [68:3 - 68:8] ClassDecl=IdentifierInfo:66:7 (Definition) +// CHECK-tokens: Keyword: "const" [68:3 - 68:8] CXXMethod=getNameStart:68:15 (Definition) // CHECK-tokens: Keyword: "char" [68:9 - 68:13] CXXMethod=getNameStart:68:15 (Definition) // CHECK-tokens: Punctuation: "*" [68:14 - 68:15] CXXMethod=getNameStart:68:15 (Definition) // CHECK-tokens: Identifier: "getNameStart" [68:15 - 68:27] CXXMethod=getNameStart:68:15 (Definition) @@ -678,7 +678,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: ")" [68:28 - 68:29] CXXMethod=getNameStart:68:15 (Definition) // CHECK-tokens: Keyword: "const" [68:30 - 68:35] CXXMethod=getNameStart:68:15 (Definition) // CHECK-tokens: Punctuation: "{" [68:36 - 68:37] CompoundStmt= -// CHECK-tokens: Keyword: "typedef" [69:5 - 69:12] DeclStmt= +// CHECK-tokens: Keyword: "typedef" [69:5 - 69:12] TypedefDecl=actualtype:69:54 (Definition) // CHECK-tokens: Identifier: "std" [69:13 - 69:16] NamespaceRef=std:3:11 // CHECK-tokens: Punctuation: "::" [69:16 - 69:18] TypedefDecl=actualtype:69:54 (Definition) // CHECK-tokens: Identifier: "pair" [69:18 - 69:22] TemplateRef=pair:4:44 @@ -710,7 +710,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: ")" [72:22 - 72:23] CXXMethod=getLength:72:12 (Definition) // CHECK-tokens: Keyword: "const" [72:24 - 72:29] CXXMethod=getLength:72:12 (Definition) // CHECK-tokens: Punctuation: "{" [72:30 - 72:31] CompoundStmt= -// CHECK-tokens: Keyword: "typedef" [73:5 - 73:12] DeclStmt= +// CHECK-tokens: Keyword: "typedef" [73:5 - 73:12] TypedefDecl=actualtype:73:54 (Definition) // CHECK-tokens: Identifier: "std" [73:13 - 73:16] NamespaceRef=std:3:11 // CHECK-tokens: Punctuation: "::" [73:16 - 73:18] TypedefDecl=actualtype:73:54 (Definition) // CHECK-tokens: Identifier: "pair" [73:18 - 73:22] TemplateRef=pair:4:44 @@ -723,7 +723,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: ">" [73:53 - 73:54] TypedefDecl=actualtype:73:54 (Definition) // CHECK-tokens: Identifier: "actualtype" [73:54 - 73:64] TypedefDecl=actualtype:73:54 (Definition) // CHECK-tokens: Punctuation: ";" [73:64 - 73:65] DeclStmt= -// CHECK-tokens: Keyword: "const" [74:5 - 74:10] DeclStmt= +// CHECK-tokens: Keyword: "const" [74:5 - 74:10] VarDecl=p:74:17 (Definition) // CHECK-tokens: Keyword: "char" [74:11 - 74:15] VarDecl=p:74:17 (Definition) // CHECK-tokens: Punctuation: "*" [74:16 - 74:17] VarDecl=p:74:17 (Definition) // CHECK-tokens: Identifier: "p" [74:17 - 74:18] VarDecl=p:74:17 (Definition) @@ -816,7 +816,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Identifier: "StringRef" [84:3 - 84:12] TypeRef=class llvm::StringRef:38:7 // CHECK-tokens: Identifier: "Str" [84:13 - 84:16] FieldDecl=Str:84:13 (Definition) // CHECK-tokens: Punctuation: ";" [84:16 - 84:17] ClassTemplate=StringSwitch:83:47 (Definition) -// CHECK-tokens: Keyword: "const" [85:3 - 85:8] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Keyword: "const" [85:3 - 85:8] FieldDecl=Result:85:12 (Definition) // CHECK-tokens: Identifier: "T" [85:9 - 85:10] TypeRef=T:83:21 // CHECK-tokens: Punctuation: "*" [85:11 - 85:12] FieldDecl=Result:85:12 (Definition) // CHECK-tokens: Identifier: "Result" [85:12 - 85:18] FieldDecl=Result:85:12 (Definition) @@ -831,9 +831,9 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: ")" [87:38 - 87:39] CXXConstructor=StringSwitch<T, R>:87:12 (Definition) // CHECK-tokens: Punctuation: ":" [87:40 - 87:41] CXXConstructor=StringSwitch<T, R>:87:12 (Definition) // CHECK-tokens: Identifier: "Str" [87:42 - 87:45] MemberRef=Str:84:13 -// CHECK-tokens: Punctuation: "(" [87:45 - 87:46] UnexposedExpr= +// CHECK-tokens: Punctuation: "(" [87:45 - 87:46] CallExpr=StringRef:38:7 // CHECK-tokens: Identifier: "Str" [87:46 - 87:49] DeclRefExpr=Str:87:35 -// CHECK-tokens: Punctuation: ")" [87:49 - 87:50] UnexposedExpr= +// CHECK-tokens: Punctuation: ")" [87:49 - 87:50] CallExpr=StringRef:38:7 // CHECK-tokens: Punctuation: "," [87:50 - 87:51] CXXConstructor=StringSwitch<T, R>:87:12 (Definition) // CHECK-tokens: Identifier: "Result" [87:52 - 87:58] MemberRef=Result:85:12 // CHECK-tokens: Punctuation: "(" [87:58 - 87:59] UnexposedExpr= @@ -850,7 +850,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: "&" [88:40 - 88:41] FunctionTemplate=Case:88:42 (Definition) // CHECK-tokens: Identifier: "Case" [88:42 - 88:46] FunctionTemplate=Case:88:42 (Definition) // CHECK-tokens: Punctuation: "(" [88:46 - 88:47] FunctionTemplate=Case:88:42 (Definition) -// CHECK-tokens: Keyword: "const" [88:47 - 88:52] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Keyword: "const" [88:47 - 88:52] ParmDecl=S:88:60 (Definition) // CHECK-tokens: Keyword: "char" [88:53 - 88:57] ParmDecl=S:88:60 (Definition) // CHECK-tokens: Punctuation: "(" [88:58 - 88:59] ParmDecl=S:88:60 (Definition) // CHECK-tokens: Punctuation: "&" [88:59 - 88:60] ParmDecl=S:88:60 (Definition) @@ -860,7 +860,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Identifier: "N" [88:63 - 88:64] DeclRefExpr=N:88:23 // CHECK-tokens: Punctuation: "]" [88:64 - 88:65] ParmDecl=S:88:60 (Definition) // CHECK-tokens: Punctuation: "," [88:65 - 88:66] FunctionTemplate=Case:88:42 (Definition) -// CHECK-tokens: Keyword: "const" [89:47 - 89:52] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Keyword: "const" [89:47 - 89:52] ParmDecl=Value:89:57 (Definition) // CHECK-tokens: Identifier: "T" [89:53 - 89:54] TypeRef=T:83:21 // CHECK-tokens: Punctuation: "&" [89:55 - 89:56] ParmDecl=Value:89:57 (Definition) // CHECK-tokens: Identifier: "Value" [89:57 - 89:62] ParmDecl=Value:89:57 (Definition) @@ -874,7 +874,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Identifier: "R" [92:3 - 92:4] TypeRef=R:83:33 // CHECK-tokens: Identifier: "Default" [92:5 - 92:12] CXXMethod=Default:92:5 (Definition) // CHECK-tokens: Punctuation: "(" [92:12 - 92:13] CXXMethod=Default:92:5 (Definition) -// CHECK-tokens: Keyword: "const" [92:13 - 92:18] CXXMethod=Default:92:5 (Definition) +// CHECK-tokens: Keyword: "const" [92:13 - 92:18] ParmDecl=Value:92:23 (Definition) // CHECK-tokens: Identifier: "T" [92:19 - 92:20] TypeRef=T:83:21 // CHECK-tokens: Punctuation: "&" [92:21 - 92:22] ParmDecl=Value:92:23 (Definition) // CHECK-tokens: Identifier: "Value" [92:23 - 92:28] ParmDecl=Value:92:23 (Definition) @@ -899,7 +899,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: "::" [100:34 - 100:36] CXXMethod=getKind:100:36 (Definition) (static) // CHECK-tokens: Identifier: "getKind" [100:36 - 100:43] CXXMethod=getKind:100:36 (Definition) (static) // CHECK-tokens: Punctuation: "(" [100:43 - 100:44] CXXMethod=getKind:100:36 (Definition) (static) -// CHECK-tokens: Keyword: "const" [100:44 - 100:49] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Keyword: "const" [100:44 - 100:49] ParmDecl=Name:100:67 (Definition) // CHECK-tokens: Identifier: "IdentifierInfo" [100:50 - 100:64] TypeRef=class clang::IdentifierInfo:66:7 // CHECK-tokens: Punctuation: "*" [100:65 - 100:66] ParmDecl=Name:100:67 (Definition) // CHECK-tokens: Identifier: "Name" [100:67 - 100:71] ParmDecl=Name:100:67 (Definition) @@ -1843,7 +1843,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK: 87:35: ParmDecl=Str:87:35 (Definition) Extent=[87:25 - 87:38] // CHECK: 87:25: TypeRef=class llvm::StringRef:38:7 Extent=[87:25 - 87:34] // CHECK: 87:42: MemberRef=Str:84:13 Extent=[87:42 - 87:45] -// CHECK: 87:45: UnexposedExpr= Extent=[87:45 - 87:50] +// CHECK: 87:42: CallExpr=StringRef:38:7 Extent=[87:42 - 87:50] // CHECK: 87:46: DeclRefExpr=Str:87:35 Extent=[87:46 - 87:49] // CHECK: 87:52: MemberRef=Result:85:12 Extent=[87:52 - 87:58] // CHECK: 87:58: UnexposedExpr= Extent=[87:58 - 87:61] diff --git a/test/Index/skip-parsed-bodies/compile_commands.json b/test/Index/skip-parsed-bodies/compile_commands.json new file mode 100644 index 0000000..da5e777 --- /dev/null +++ b/test/Index/skip-parsed-bodies/compile_commands.json @@ -0,0 +1,71 @@ +[ +{ + "directory": ".", + "command": "/usr/bin/clang++ -fsyntax-only t1.cpp", + "file": "t1.cpp" +}, +{ + "directory": ".", + "command": "/usr/bin/clang++ -fsyntax-only t2.cpp -DBLAH", + "file": "t2.cpp" +}, +{ + "directory": ".", + "command": "/usr/bin/clang++ -fsyntax-only t3.cpp -DBLAH", + "file": "t2.cpp" +} +] + +// XFAIL: mingw32,win32 +// RUN: c-index-test -index-compile-db %s | FileCheck %s + +// CHECK: [enteredMainFile]: t1.cpp +// CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 +// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:9:27 +// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 +// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: 1 +// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | +// CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C | +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:15:5 +// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:19:5 +// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val1' +// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val2' +// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val3' + +// CHECK-NEXT: [enteredMainFile]: t2.cpp +// CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 +// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped +// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 +// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isContainer: skipped +// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | +// CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C | +// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped +// CHECK-NEXT: [ppIncludedFile]: ./pragma_once.h +// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:25:5 +// CHECK: [indexDeclaration]: kind: c++-instance-method | name: tsmeth | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./pragma_once.h:8:7 +// CHECK: [indexDeclaration]: kind: function | name: imp_foo | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./imported.h:4:5 +// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val4' +// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_tsval' +// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_impval' + +// CHECK-NEXT: [enteredMainFile]: t3.cpp +// CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 +// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped +// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 +// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: skipped +// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | +// CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C | +// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped +// CHECK-NEXT: [ppIncludedFile]: ./pragma_once.h +// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped +// CHECK-NEXT: [indexDeclaration]: kind: variable | {{.*}} | loc: ./pragma_once.h:3:12 +// CHECK: [indexDeclaration]: kind: c++-instance-method | name: tsmeth | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped +// CHECK-NOT: [indexEntityReference]: kind: variable | name: some_val | +// CHECK: [indexDeclaration]: kind: function | name: imp_foo | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped +// CHECK-NOT: [indexEntityReference]: kind: variable | name: some_val | +// CHECK-NOT: [diagnostic]: {{.*}} undeclared identifier diff --git a/test/Index/skip-parsed-bodies/imported.h b/test/Index/skip-parsed-bodies/imported.h new file mode 100644 index 0000000..86673e1 --- /dev/null +++ b/test/Index/skip-parsed-bodies/imported.h @@ -0,0 +1,5 @@ +extern int some_val; + +static inline int imp_foo() { + ++some_val; return undef_impval; +} diff --git a/test/Index/skip-parsed-bodies/lit.local.cfg b/test/Index/skip-parsed-bodies/lit.local.cfg new file mode 100644 index 0000000..b38b51a --- /dev/null +++ b/test/Index/skip-parsed-bodies/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = ['.json'] diff --git a/test/Index/skip-parsed-bodies/pragma_once.h b/test/Index/skip-parsed-bodies/pragma_once.h new file mode 100644 index 0000000..76d2d94 --- /dev/null +++ b/test/Index/skip-parsed-bodies/pragma_once.h @@ -0,0 +1,10 @@ +#pragma once + +extern int some_val; + +template <typename T> +struct TS { + int tsmeth() { + ++some_val; return undef_tsval; + } +}; diff --git a/test/Index/skip-parsed-bodies/t.h b/test/Index/skip-parsed-bodies/t.h new file mode 100644 index 0000000..a52b749 --- /dev/null +++ b/test/Index/skip-parsed-bodies/t.h @@ -0,0 +1,30 @@ +#ifndef _T_H_ +#define _T_H_ + +extern int some_val; + +namespace NS { + class C { + void method_decl(); + int method_def1() { ++some_val; return undef_val1; } + inline int method_def2(); + }; +} + +inline int NS::C::method_def2() { + ++some_val; return undef_val2; +} + +static inline int foo1() { + ++some_val; return undef_val3; +} + +#ifdef BLAH + +static inline int foo2() { + ++some_val; return undef_val4; +} + +#endif + +#endif diff --git a/test/Index/skip-parsed-bodies/t1.cpp b/test/Index/skip-parsed-bodies/t1.cpp new file mode 100644 index 0000000..05918d7 --- /dev/null +++ b/test/Index/skip-parsed-bodies/t1.cpp @@ -0,0 +1 @@ +#include "t.h" diff --git a/test/Index/skip-parsed-bodies/t2.cpp b/test/Index/skip-parsed-bodies/t2.cpp new file mode 100644 index 0000000..93fff44 --- /dev/null +++ b/test/Index/skip-parsed-bodies/t2.cpp @@ -0,0 +1,3 @@ +#include "t.h" +#include "pragma_once.h" +#import "imported.h" diff --git a/test/Index/skip-parsed-bodies/t3.cpp b/test/Index/skip-parsed-bodies/t3.cpp new file mode 100644 index 0000000..93fff44 --- /dev/null +++ b/test/Index/skip-parsed-bodies/t3.cpp @@ -0,0 +1,3 @@ +#include "t.h" +#include "pragma_once.h" +#import "imported.h" diff --git a/test/Index/usrs.cpp b/test/Index/usrs.cpp index 023818c..e350f5c 100644 --- a/test/Index/usrs.cpp +++ b/test/Index/usrs.cpp @@ -101,8 +101,8 @@ void rdar9371763() { // CHECK: usrs.cpp c:@N@foo@C@ClsB@F@ClsB# Extent=[19:5 - 19:27] // CHECK: usrs.cpp c:@N@foo@C@ClsB@F@result#1 Extent=[20:5 - 20:23] // CHECK: usrs.cpp c:@N@foo@C@ClsB@F@result#1 Extent=[24:1 - 26:2] -// CHECK: usrs.cpp c:@aN@C@ClsC Extent=[29:3 - 29:35] -// CHECK: usrs.cpp c:@aN@w Extent=[30:3 - 30:8] +// CHECK: usrs.cpp c:usrs.cpp@360@aN@C@ClsC Extent=[29:3 - 29:35] +// CHECK: usrs.cpp c:usrs.cpp@396@aN@w Extent=[30:3 - 30:8] // CHECK: usrs.cpp c:@z Extent=[33:1 - 33:6] // CHECK: usrs.cpp c:@N@foo Extent=[35:1 - 40:2] // CHECK: usrs.cpp c:@N@foo@N@taz Extent=[35:17 - 39:2] @@ -137,7 +137,7 @@ void rdar9371763() { // CHECK-NOT: ClsB // CHECK: usrs.cpp c:@NA@foo_alias3 // CHECK: usrs.cpp c:@aN Extent=[68:1 - 73:2] -// CHECK: usrs.cpp c:@aN@C@RDar9371763_Foo Extent=[69:1 - 72:2] +// CHECK: usrs.cpp c:usrs.cpp@1097@aN@C@RDar9371763_Foo Extent=[69:1 - 72:2] // CHECK: usrs.cpp c: Extent=[70:1 - 70:8] // CHECK: usrs.cpp c:usrs.cpp@1131@aN@C@RDar9371763_Foo@F@bar# Extent=[71:3 - 71:13] // CHECK: usrs.cpp c:usrs.cpp@1131@aN@C@RDar9371763_Foo@F@bar# Extent=[75:1 - 75:31] diff --git a/test/Index/vector-types.c b/test/Index/vector-types.c deleted file mode 100644 index 404e4a5..0000000 --- a/test/Index/vector-types.c +++ /dev/null @@ -1,6 +0,0 @@ -int __attribute__((vector_size(16))) x; -typedef int __attribute__((vector_size(16))) int4_t; - -// RUN: c-index-test -test-print-typekind %s | FileCheck %s -// CHECK: VarDecl=x:1:38 typekind=Vector [isPOD=1] -// CHECK: TypedefDecl=int4_t:2:46 (Definition) typekind=Typedef [canonical=Vector] [isPOD=1] |