From c068ff72c526c75f3ba87b7a5ef6d051a17e3c45 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 23 Jan 2018 17:10:25 +0000 Subject: clang-format: Support macros in front of @interface / @protocol for ObjC code. llvm-svn: 323226 --- clang/unittests/Format/FormatTestObjC.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'clang/unittests/Format/FormatTestObjC.cpp') diff --git a/clang/unittests/Format/FormatTestObjC.cpp b/clang/unittests/Format/FormatTestObjC.cpp index 6cb5729e252..879932db0db 100644 --- a/clang/unittests/Format/FormatTestObjC.cpp +++ b/clang/unittests/Format/FormatTestObjC.cpp @@ -215,6 +215,12 @@ TEST_F(FormatTestObjC, FormatObjCInterface) { "@end"); verifyFormat("@interface Foo : Bar\n" + "@property(assign, readwrite) NSInteger bar;\n" + "+ (id)init;\n" + "@end"); + + verifyFormat("FOUNDATION_EXPORT NS_AVAILABLE_IOS(10.0) @interface Foo : Bar\n" + "@property(assign, readwrite) NSInteger bar;\n" "+ (id)init;\n" "@end"); @@ -394,6 +400,10 @@ TEST_F(FormatTestObjC, FormatObjCProtocol) { "@protocol Bar\n" "@end"); + verifyFormat("FOUNDATION_EXPORT NS_AVAILABLE_IOS(10.0) @protocol Foo\n" + "@property(assign, readwrite) NSInteger bar;\n" + "@end"); + verifyFormat("@protocol myProtocol\n" "- (void)mandatoryWithInt:(int)i;\n" "@optional\n" -- cgit v1.2.3