aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-01-14 10:58:01 +0000
committerManuel Klimek <klimek@google.com>2013-01-14 10:58:01 +0000
commit1b6f4bd8d7e75e775053b1cb1281c6a127746e93 (patch)
treeb8eba72db22213ef1978d33f133eee2cde7d8811 /unittests/Format/FormatTest.cpp
parentd6e7fae82b857eaeb487ceb591942b8969afdd96 (diff)
Adds some more tests for * and &.
While reviewing r172303 I noticed that I wasn't sure whether we still format those correctly and didn't see any tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index b05d19c652..2f66e5454c 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1074,6 +1074,12 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyGoogleFormat("A<int**, int**> a;");
verifyGoogleFormat("f(b ? *c : *d);");
verifyGoogleFormat("int a = b ? *c : *d;");
+
+ verifyFormat("a = *(x + y);");
+ verifyFormat("a = &(x + y);");
+ verifyFormat("*(x + y).call();");
+ verifyFormat("&(x + y)->call();");
+ verifyFormat("&(*I).first");
}
TEST_F(FormatTest, FormatsCasts) {