diff options
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index dec0ea72b58a..942c6259015e 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -13832,6 +13832,20 @@ TEST_F(FormatTest, PullTrivialFunctionDefinitionsIntoSingleLine) { "}", format("A()\n:b(0)\n{\n}", NoColumnLimit)); + FormatStyle NoColumnLimitWrapAfterFunction = NoColumnLimit; + NoColumnLimitWrapAfterFunction.BreakBeforeBraces = FormatStyle::BS_Custom; + NoColumnLimitWrapAfterFunction.BraceWrapping.AfterFunction = true; + verifyFormat("class C {\n" + "#pragma foo\n" + " int foo { return 0; }\n" + "};", + NoColumnLimitWrapAfterFunction); + verifyFormat("class C {\n" + "#pragma foo\n" + " void foo {}\n" + "};", + NoColumnLimitWrapAfterFunction); + FormatStyle DoNotMergeNoColumnLimit = NoColumnLimit; DoNotMergeNoColumnLimit.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None; @@ -20120,9 +20134,7 @@ TEST_F(FormatTest, WhitesmithsBraceBreaking) { " int i = 5;\n" " }\n" "#ifdef _DEBUG\n" - "void bar()\n" - " {\n" - " }\n" + "void bar() {}\n" "#else\n" "void bar()\n" " {\n" |