summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-05-18 13:47:23 +0000
committerDaniel Jasper <djasper@google.com>2015-05-18 13:47:23 +0000
commit47bbda093917d7e16f59df20ae409c07b4624e30 (patch)
tree79868eb7303cc1df9f8aa5b71aff53dfda86d4da /clang/unittests/Format
parent055ad9beba8db1c124c329a8359ab16b903d754a (diff)
downloadbcm5719-llvm-47bbda093917d7e16f59df20ae409c07b4624e30.tar.gz
bcm5719-llvm-47bbda093917d7e16f59df20ae409c07b4624e30.zip
clang-format: Improve detection of macros annotating functions.
Before: ASSERT("aaaaaaaaaaaaaaa") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; After: ASSERT("aaaaaaaaaaaaaaa") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; Also cleanup implementation a bit and only mark closing parenthesis of these annotations. llvm-svn: 237567
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r--clang/unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index f41928fe725..00c23b5bcc1 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4046,6 +4046,10 @@ TEST_F(FormatTest, FunctionAnnotations) {
verifyFormat("template <typename T>\n"
"DEPRECATED(\"Use NewClass::NewFunction instead.\")\n"
"string OldFunction(const string &parameter) {}");
+
+ // Not function annotations.
+ verifyFormat("ASSERT(\"aaaaa\") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
+ " << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
}
TEST_F(FormatTest, BreaksDesireably) {
OpenPOWER on IntegriCloud