Add objective-C style formatting to clang format and
use it to format xml declaration tags. 
// rdar://12378714


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170727 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index c9cd825..53253f0 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -667,5 +667,24 @@
 
 }
 
+TEST_F(FormatTest, FormatForObjectiveCMethodDecls) {
+  verifyFormat("- (void)sendAction:(SEL)aSelector to:(BOOL)anObject;");
+  EXPECT_EQ("- (NSUInteger)indexOfObject:(id)anObject;",
+            format("-(NSUInteger)indexOfObject:(id)anObject;"));
+  EXPECT_EQ("- (NSInteger)Mthod1;",
+            format("-(NSInteger)Mthod1;"));
+  EXPECT_EQ("+ (id)Mthod2;", format("+(id)Mthod2;"));
+  EXPECT_EQ("- (NSInteger)Method3:(id)anObject;",
+            format("-(NSInteger)Method3:(id)anObject;"));
+  EXPECT_EQ("- (NSInteger)Method4:(id)anObject;",
+            format("-(NSInteger)Method4:(id)anObject;"));
+  EXPECT_EQ("- (NSInteger)Method5:(id)anObject:(id)AnotherObject;",
+            format("-(NSInteger)Method5:(id)anObject:(id)AnotherObject;"));
+  EXPECT_EQ("- (id)Method6:(id)A:(id)B:(id)C:(id)D;",
+            format("- (id)Method6:(id)A:(id)B:(id)C:(id)D;"));
+  EXPECT_EQ("- (void)sendAction:(SEL)aSelector to:(id)anObject forAllCells:(BOOL)flag;",
+            format("- (void)sendAction:(SEL)aSelector to:(id)anObject forAllCells:(BOOL)flag;"));
+}
+
 }  // end namespace tooling
 }  // end namespace clang