diff options
author | Daniel Jasper <djasper@google.com> | 2013-10-30 14:04:10 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-10-30 14:04:10 +0000 |
commit | 16fc75421688428ce6c84cccdaba87c694484045 (patch) | |
tree | 76c1c93e89ab5444b218a41cc2fc417344c49a62 /clang/unittests/Format/FormatTest.cpp | |
parent | 9885784d67d7154eb5861130cc2b4b29e4cbf9ea (diff) | |
download | bcm5719-llvm-16fc75421688428ce6c84cccdaba87c694484045.tar.gz bcm5719-llvm-16fc75421688428ce6c84cccdaba87c694484045.zip |
clang-format: Fix indenting corner case with comment and else.
Before:
if (a) {
f();
}
// or else ..
else {
g();
}
After:
if (a) {
f();
}
// or else ..
else {
g();
}
llvm-svn: 193684
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 639b8c89d95..5852d1c0ed4 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -374,6 +374,13 @@ TEST_F(FormatTest, ElseIf) { " g();\n" "else\n" " h();"); + verifyFormat("if (a) {\n" + " f();\n" + "}\n" + "// or else ..\n" + "else {\n" + " g()\n" + "}"); } TEST_F(FormatTest, FormatsForLoop) { |