summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-05-18 09:47:22 +0000
committerDaniel Jasper <djasper@google.com>2015-05-18 09:47:22 +0000
commitf090f031bc367b73217c82ab7607ef1a129c574d (patch)
tree4a32650dc07676384b300aabb4897200dd8196d6 /clang/unittests/Format/FormatTest.cpp
parent8fc69dcf42417866b960ae6dbdb284fb8e70c393 (diff)
downloadbcm5719-llvm-f090f031bc367b73217c82ab7607ef1a129c574d.tar.gz
bcm5719-llvm-f090f031bc367b73217c82ab7607ef1a129c574d.zip
clang-format: Support function annotations in macros.
Before: DEPRECATED("Use NewClass::NewFunction instead.") string OldFunction(const string &parameter) {} After: DEPRECATED("Use NewClass::NewFunction instead.") string OldFunction(const string &parameter) {} llvm-svn: 237562
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index f7510c86189..5e69e05d4a4 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4040,6 +4040,14 @@ TEST_F(FormatTest, BreaksFunctionDeclarationsWithTrailingTokens) {
" aaaaaaaaaaaaaaaaaaaaaaaaa;");
}
+TEST_F(FormatTest, FunctionAnnotations) {
+ verifyFormat("DEPRECATED(\"Use NewClass::NewFunction instead.\")\n"
+ "string OldFunction(const string &parameter) {}");
+ verifyFormat("template <typename T>\n"
+ "DEPRECATED(\"Use NewClass::NewFunction instead.\")\n"
+ "string OldFunction(const string &parameter) {}");
+}
+
TEST_F(FormatTest, BreaksDesireably) {
verifyFormat("if (aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa) ||\n"
" aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa) ||\n"
OpenPOWER on IntegriCloud