aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-12-23 01:07:46 +0000
committerNico Weber <nicolasweber@gmx.de>2012-12-23 01:07:46 +0000
commit00d5a04dc0eaa0f067656033ab81fc352c5a991a (patch)
tree09f5a5d177cc70be2571cae091dea43413c097ab /unittests/Format/FormatTest.cpp
parente6bb76cde5488eca94e087e8929f29f3f3debfd3 (diff)
libFormat: Teach the *& usage heuristic that "return" starts a rhs too.
"return a*b;" was formatted as "return a *b;" and is now formatted as "return a * b;". Fixes PR14687 partially. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index f954c14ef7..b316750a0b 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -592,6 +592,9 @@ TEST_F(FormatTest, UnderstandsUsesOfStar) {
verifyFormat("int a = *b * c;");
verifyFormat("int a = b * *c;");
verifyFormat("int main(int argc, char **argv) {\n}");
+ verifyFormat("return 10 * b;");
+ verifyFormat("return *b * *c;");
+ verifyFormat("return a & ~b;");
// FIXME: Is this desired for LLVM? Fix if not.
verifyFormat("A<int *> a;");