aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-03-14 09:50:46 +0000
committerDaniel Jasper <djasper@google.com>2013-03-14 09:50:46 +0000
commit8ef19a22956defa392df46c79e2d499ab7b16647 (patch)
treed06c7cce5b97b977e4325909fe554f23a4b1e357 /unittests/Format/FormatTest.cpp
parentc3ae583a9a2e0e5c862a94b678c7cdfaab46a981 (diff)
Improve formatting of trailing annotations.
Before: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__(( unused)); After: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__((unused)); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 4e54212f99..ac9dd64418 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1387,15 +1387,23 @@ TEST_F(FormatTest, FormatsBuilderPattern) {
TEST_F(FormatTest, DoesNotBreakTrailingAnnotation) {
verifyFormat("void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
- " GUARDED_BY(aaaaaaaaaaaaa);");
+ " LOCKS_EXCLUDED(aaaaaaaaaaaaa);");
verifyFormat("void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) const\n"
- " GUARDED_BY(aaaaaaaaaaaaa);");
+ " LOCKS_EXCLUDED(aaaaaaaaaaaaa);");
verifyFormat("void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) const\n"
- " GUARDED_BY(aaaaaaaaaaaaa) {}");
+ " LOCKS_EXCLUDED(aaaaaaaaaaaaa) {}");
verifyFormat(
"void aaaaaaaaaaaaaaaaaa()\n"
" __attribute__((aaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa,\n"
" aaaaaaaaaaaaaaaaaaaaaaaaa));");
+ verifyFormat("bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
+ " __attribute__((unused));");
+
+ // FIXME: This is bad indentation, but generally hard to distinguish from a
+ // function declaration.
+ verifyFormat(
+ "bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
+ "GUARDED_BY(aaaaaaaaaaaa);");
}
TEST_F(FormatTest, BreaksAccordingToOperatorPrecedence) {