aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-11 14:23:32 +0000
committerDaniel Jasper <djasper@google.com>2013-01-11 14:23:32 +0000
commit7d19bc2c8882457e833dfe9741ac5a4a7198e46f (patch)
tree00d4f5cbb291783306f2cb6f324e30521b64972f /unittests/Format/FormatTest.cpp
parent7e9bf8c249a5a9717447a00a8669596002a5569a (diff)
Improve handling of trailing declaration annotations.
Before: void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) GUARDED_BY( aaaaaaaaaaaaa); After: void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) GUARDED_BY(aaaaaaaaaaaaa); Also did some formatting cleanups with clang-format on the way. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index e60ed3722e..47e6bdd114 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -741,6 +741,11 @@ TEST_F(FormatTest, BreaksDesireably) {
" }\n }\n}");
}
+TEST_F(FormatTest, DoesNotBreakTrailingAnnotation) {
+ verifyFormat("void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
+ " GUARDED_BY(aaaaaaaaaaaaa);");
+}
+
TEST_F(FormatTest, BreaksAccordingToOperatorPrecedence) {
verifyFormat(
"if (aaaaaaaaaaaaaaaaaaaaaaaaa ||\n"