Index: lib/Format/Format.cpp =================================================================== --- lib/Format/Format.cpp +++ lib/Format/Format.cpp @@ -877,6 +877,8 @@ } else if (Language == FormatStyle::LK_ObjC) { GoogleStyle.AlwaysBreakBeforeMultilineStrings = false; GoogleStyle.ColumnLimit = 100; + GoogleStyle.IncludeStyle.IncludeBlocks = + tooling::IncludeStyle::IBS_Preserve; } return GoogleStyle; Index: unittests/Format/SortIncludesTest.cpp =================================================================== --- unittests/Format/SortIncludesTest.cpp +++ unittests/Format/SortIncludesTest.cpp @@ -653,6 +653,18 @@ EXPECT_EQ(Code, sort(Code, "input.h", 0)); } + +TEST_F(SortIncludesTest, DoNotRegroupGroupsInGoogleObjCStyle) { + FmtStyle = getGoogleStyle(FormatStyle::LK_ObjC); + + EXPECT_EQ("#include \n" + "#include \n" + "#include \"a.h\"", + sort("#include \n" + "#include \n" + "#include \"a.h\"")); +} + } // end namespace } // end namespace format } // end namespace clang