summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-07-09 08:42:42 +0000
committerDaniel Jasper <djasper@google.com>2014-07-09 08:42:42 +0000
commitc75e1effed73e1a3f7e9b509634648d71c1dddcf (patch)
tree55d9255a471826b6195cf0de94a97209618730a3 /clang/unittests/Format/FormatTest.cpp
parente40fb373ef4f93fd3c22ad094260512044bab0fe (diff)
downloadbcm5719-llvm-c75e1effed73e1a3f7e9b509634648d71c1dddcf.tar.gz
bcm5719-llvm-c75e1effed73e1a3f7e9b509634648d71c1dddcf.zip
clang-format: Add new option to indent wrapped function declarations.
Though not completely identical, make former IndentFunctionDeclarationAfterType change this flag for backwards compatibility (it is somewhat close in meaning and better the err'ing on an unknown config flag). llvm-svn: 212597
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 7029b43f05b..150497745b3 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5082,6 +5082,23 @@ TEST_F(FormatTest, BreaksLongDeclarations) {
"LooooooooooooooooooooooooooooooooooongFunctionDefinition() {}");
verifyFormat("decltype(LoooooooooooooooooooooooooooooooooooooooongName)\n"
"LooooooooooooooooooooooooooooooooooongFunctionDefinition() {}");
+ FormatStyle Indented = getLLVMStyle();
+ Indented.IndentWrappedFunctionNames = true;
+ verifyFormat("LoooooooooooooooooooooooooooooooooooooooongReturnType\n"
+ " LoooooooooooooooooooooooooooooooongFunctionDeclaration();",
+ Indented);
+ verifyFormat(
+ "LoooooooooooooooooooooooooooooooooooooooongReturnType\n"
+ " LooooooooooooooooooooooooooooooooooongFunctionDefinition() {}",
+ Indented);
+ verifyFormat(
+ "LoooooooooooooooooooooooooooooooooooooooongReturnType const\n"
+ " LooooooooooooooooooooooooooooooooooongFunctionDefinition() {}",
+ Indented);
+ verifyFormat(
+ "decltype(LoooooooooooooooooooooooooooooooooooooooongName)\n"
+ " LooooooooooooooooooooooooooooooooooongFunctionDefinition() {}",
+ Indented);
// FIXME: Without the comment, this breaks after "(".
verifyFormat("LoooooooooooooooooooooooooooooooooooooooongType // break\n"
@@ -8103,6 +8120,7 @@ TEST_F(FormatTest, ParsesConfiguration) {
CHECK_PARSE_BOOL(ConstructorInitializerAllOnOneLineOrOnePerLine);
CHECK_PARSE_BOOL(DerivePointerAlignment);
CHECK_PARSE_BOOL(IndentCaseLabels);
+ CHECK_PARSE_BOOL(IndentWrappedFunctionNames);
CHECK_PARSE_BOOL(KeepEmptyLinesAtTheStartOfBlocks);
CHECK_PARSE_BOOL(ObjCSpaceAfterProperty);
CHECK_PARSE_BOOL(ObjCSpaceBeforeProtocolList);
OpenPOWER on IntegriCloud