diff options
author | Daniel Jasper <djasper@google.com> | 2013-05-16 16:54:34 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-05-16 16:54:34 +0000 |
commit | 9271650e6198348ddf4c503a5c59aa734379973b (patch) | |
tree | 710b8fedd49c44062378cf550e1f1c399439a9a1 | |
parent | 47db66d43fd441eb8d619036fb5440a7fc69fb3f (diff) | |
download | bcm5719-llvm-9271650e6198348ddf4c503a5c59aa734379973b.tar.gz bcm5719-llvm-9271650e6198348ddf4c503a5c59aa734379973b.zip |
Add additional test-case for one-line-function.
This ensures that we format:
void longFunctionName {
} // long comment here
And not:
void longFunctionName {}
// long comment here
As requested in post-commit-review.
llvm-svn: 182024
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 37e9ba8643d..841ac552a55 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -3066,6 +3066,9 @@ TEST_F(FormatTest, PullTrivialFunctionDefinitionsIntoSingleLine) { "}"); verifyFormat("void f() {} // comment"); verifyFormat("void f() { int a; } // comment"); + verifyFormat("void f() {\n" + "} // comment", + getLLVMStyleWithColumns(15)); verifyFormat("void f() { return 42; }", getLLVMStyleWithColumns(23)); verifyFormat("void f() {\n return 42;\n}", getLLVMStyleWithColumns(22)); |