From 60d4b99693986c8e64b9aca4755a43a1737ce0ee Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Thu, 15 Nov 2012 18:37:27 +0000 Subject: [PATCH] Comment to XML conversion: convert some tests to use the new [[@LINE]] FileCheck feature. This will hopefully make tests less fragile. llvm-svn: 168056 --- .../annotate-comments-availability-attrs.cpp | 25 +++---- .../test/Index/overriding-method-comments.mm | 73 ++++++++++--------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/clang/test/Index/annotate-comments-availability-attrs.cpp b/clang/test/Index/annotate-comments-availability-attrs.cpp index 777881d683e8..74a57b9beeb2 100644 --- a/clang/test/Index/annotate-comments-availability-attrs.cpp +++ b/clang/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 "))) __attribute__((availability(ios,unavailable, message="not for iOS"))); +// CHECK: FullCommentAsXML=[attr_availability_1c:@F@attr_availability_1#void attr_availability_1() Aaa.not for iOS8.09.010.0use availability_test in <foo.h>] + /// Aaa. void attr_availability_2() __attribute__((availability(macosx,obsoleted=10.0.1,introduced=8.0.1,deprecated=9.0.1))); +// CHECK: FullCommentAsXML=[attr_availability_2c:@F@attr_availability_2#void attr_availability_2() Aaa.8.0.19.0.110.0.1] + /// Aaa. void attr_deprecated_1() __attribute__((deprecated)); +// CHECK: FullCommentAsXML=[attr_deprecated_1c:@F@attr_deprecated_1#void attr_deprecated_1() Aaa.] + /// Aaa. void attr_deprecated_2() __attribute__((deprecated("message 1 "))); +// CHECK: FullCommentAsXML=[attr_deprecated_2c:@F@attr_deprecated_2#void attr_deprecated_2() Aaa.message 1 <foo.h>] + + /// Aaa. void attr_unavailable_1() __attribute__((unavailable)); +// CHECK: FullCommentAsXML=[attr_unavailable_1c:@F@attr_unavailable_1#void attr_unavailable_1() Aaa.] + /// Aaa. void attr_unavailable_2() __attribute__((unavailable("message 2 "))); -// CHECK: FullCommentAsXML=[attr_availability_1c:@F@attr_availability_1#void attr_availability_1() Aaa.not for iOS8.09.010.0use availability_test in <foo.h>] +// CHECK: FullCommentAsXML=[attr_unavailable_2c:@F@attr_unavailable_2#void attr_unavailable_2() Aaa.message 2 <foo.h>] - -// CHECK: FullCommentAsXML=[attr_availability_2c:@F@attr_availability_2#void attr_availability_2() Aaa.8.0.19.0.110.0.1] - -// CHECK: FullCommentAsXML=[attr_deprecated_1c:@F@attr_deprecated_1#void attr_deprecated_1() Aaa.] - -// CHECK: FullCommentAsXML=[attr_deprecated_2c:@F@attr_deprecated_2#void attr_deprecated_2() Aaa.message 1 <foo.h>] - - -// CHECK: FullCommentAsXML=[attr_unavailable_1c:@F@attr_unavailable_1#void attr_unavailable_1() Aaa.] - - -// CHECK: FullCommentAsXML=[attr_unavailable_2c:@F@attr_unavailable_2#void attr_unavailable_2() Aaa.message 2 <foo.h>] diff --git a/clang/test/Index/overriding-method-comments.mm b/clang/test/Index/overriding-method-comments.mm index e7181380cb81..1641e85ef5d7 100644 --- a/clang/test/Index/overriding-method-comments.mm +++ b/clang/test/Index/overriding-method-comments.mm @@ -19,6 +19,8 @@ - (void)METH:(id)AAA; @end +// CHECK: FullCommentAsXML=[METH:c:objc(cs)Root(im)METH:- (void) METH:(id)AAAAAA0in ZZZ ] + @interface Sub : Root @end @@ -26,99 +28,98 @@ - (void)METH:(id)BBB; @end +// CHECK: FullCommentAsXML=[METH:c:objc(cs)Root(im)METH:- (void) METH:(id)BBBBBB0in ZZZ ] + @implementation Sub(CAT) - (void)METH:(id)III {} @end +// CHECK: FullCommentAsXML=[METH:c:objc(cs)Root(im)METH:- (void) METH:(id)IIIIII0in ZZZ ] + @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=[EXT_METH:::c:objc(cs)Redec(im)EXT_METH:::- (void) EXT_METH:(id)AAA :(double)BBB :(int)CCCAAA0in input value BBB1in 2nd input value is double CCC2out output value is int ] + @implementation Redec - (void)EXT_METH:(id)PPP : (double)QQQ : (int)RRR {} @end +// CHECK: FullCommentAsXML=[EXT_METH:::c:objc(cs)Redec(im)EXT_METH:::- (void) EXT_METH:(id)PPP :(double)QQQ :(int)RRRPPP0in input value QQQ1in 2nd input value is double RRR2out output value is int ] + struct Base { /// \brief Does something. /// \param AAA argument to foo_pure. virtual void foo_pure(int AAA) = 0; +// CHECK: FullCommentAsXML=[foo_purec:@S@Base@F@foo_pure#I#virtual void foo_pure(int AAA) = 0 Does something. AAA0in argument to foo_pure.] + /// \brief Does something. /// \param BBB argument to defined virtual. virtual void foo_inline(int BBB) {} +// CHECK: FullCommentAsXML=[foo_inlinec:@S@Base@F@foo_inline#I#virtual void foo_inline(int BBB) Does something. BBB0in argument to defined virtual.] + /// \brief Does something. /// \param CCC argument to undefined virtual. virtual void foo_outofline(int CCC); + +// CHECK: FullCommentAsXML=[foo_outoflinec:@S@Base@F@foo_outofline#I#virtual void foo_outofline(int CCC) Does something. CCC0in argument to undefined virtual.] }; void Base::foo_outofline(int RRR) {} +// CHECK: FullCommentAsXML=[foo_outoflinec:@S@Base@F@foo_outofline#I#void foo_outofline(int RRR) Does something. RRR0in argument to undefined virtual.] + struct Derived : public Base { virtual void foo_pure(int PPP); +// CHECK: FullCommentAsXML=[foo_purec:@S@Base@F@foo_pure#I#virtual void foo_pure(int PPP) Does something. PPP0in argument to foo_pure.] + virtual void foo_inline(int QQQ) {} + +// CHECK: FullCommentAsXML=[foo_inlinec:@S@Base@F@foo_inline#I#virtual void foo_inline(int QQQ) Does something. QQQ0in argument to defined virtual.] }; /// \brief Does something. /// \param DDD a value. void foo(int DDD); +// CHECK: FullCommentAsXML=[fooc:@F@foo#I#void foo(int DDD) Does something. DDD0in a value.] + void foo(int SSS) {} +// CHECK: FullCommentAsXML=[fooc:@F@foo#I#void foo(int SSS) Does something. SSS0in a value.] + /// \brief Does something. -/// \param EEE argument to function decl. +/// \param EEE argument to function decl. void foo1(int EEE); +// CHECK: FullCommentAsXML=[foo1c:@F@foo1#I#void foo1(int EEE) Does something. EEE0in argument to function decl.] + void foo1(int TTT); +// CHECK: FullCommentAsXML=[foo1c:@F@foo1#I#void foo1(int TTT) Does something. TTT0in argument to function decl.] + /// \brief Documentation /// \tparam BBB The type, silly. /// \tparam AAA The type, silly as well. template void foo(AAA, BBB); +// CHECK: FullCommentAsXML=[fooc:@FT@>2#T#Tfoo#t0.0#t0.1#template <typename AAA, typename BBB> void foo(AAA, BBB) Documentation AAA0 The type, silly as well.BBB1 The type, silly. ] + template void foo(PPP, QQQ); -// CHECK: FullCommentAsXML=[METH:c:objc(cs)Root(im)METH:- (void) METH:(id)AAAAAA0in ZZZ ] +// CHECK: FullCommentAsXML=[fooc:@FT@>2#T#Tfoo#t0.0#t0.1#template <typename PPP, typename QQQ> void foo(PPP, QQQ) Documentation PPP0 The type, silly as well.QQQ1 The type, silly. ] -// CHECK: FullCommentAsXML=[METH:c:objc(cs)Root(im)METH:- (void) METH:(id)BBBBBB0in ZZZ ] - -// CHECK: FullCommentAsXML=[METH:c:objc(cs)Root(im)METH:- (void) METH:(id)IIIIII0in ZZZ ] - -// CHECK: FullCommentAsXML=[EXT_METH:::c:objc(cs)Redec(im)EXT_METH:::- (void) EXT_METH:(id)AAA :(double)BBB :(int)CCCAAA0in input value BBB1in 2nd input value is double CCC2out output value is int ] - -// CHECK: FullCommentAsXML=[EXT_METH:::c:objc(cs)Redec(im)EXT_METH:::- (void) EXT_METH:(id)PPP :(double)QQQ :(int)RRRPPP0in input value QQQ1in 2nd input value is double RRR2out output value is int ] - -// CHECK: FullCommentAsXML=[foo_purec:@S@Base@F@foo_pure#I#virtual void foo_pure(int AAA) = 0 Does something. AAA0in argument to foo_pure.] - -// CHECK: FullCommentAsXML=[foo_inlinec:@S@Base@F@foo_inline#I#virtual void foo_inline(int BBB) Does something. BBB0in argument to defined virtual.] - -// CHECK: FullCommentAsXML=[foo_outoflinec:@S@Base@F@foo_outofline#I#virtual void foo_outofline(int CCC) Does something. CCC0in argument to undefined virtual.] - -// CHECK: FullCommentAsXML=[foo_outoflinec:@S@Base@F@foo_outofline#I#void foo_outofline(int RRR) Does something. RRR0in argument to undefined virtual.] - -// CHECK: FullCommentAsXML=[foo_purec:@S@Base@F@foo_pure#I#virtual void foo_pure(int PPP) Does something. PPP0in argument to foo_pure.] - -// CHECK: FullCommentAsXML=[foo_inlinec:@S@Base@F@foo_inline#I#virtual void foo_inline(int QQQ) Does something. QQQ0in argument to defined virtual.] - -// CHECK: FullCommentAsXML=[fooc:@F@foo#I#void foo(int DDD) Does something. DDD0in a value.] - -// CHECK: FullCommentAsXML=[fooc:@F@foo#I#void foo(int SSS) Does something. SSS0in a value.] - -// CHECK: FullCommentAsXML=[foo1c:@F@foo1#I#void foo1(int EEE) Does something. EEE0in argument to function decl. ] - -// CHECK: FullCommentAsXML=[foo1c:@F@foo1#I#void foo1(int TTT) Does something. TTT0in argument to function decl. ] - -// CHECK: FullCommentAsXML=[fooc:@FT@>2#T#Tfoo#t0.0#t0.1#template <typename AAA, typename BBB> void foo(AAA, BBB) Documentation AAA0 The type, silly as well.BBB1 The type, silly. ] - -// CHECK: FullCommentAsXML=[fooc:@FT@>2#T#Tfoo#t0.0#t0.1#template <typename PPP, typename QQQ> void foo(PPP, QQQ) Documentation PPP0 The type, silly as well.QQQ1 The type, silly. ]