summaryrefslogtreecommitdiffstats
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
commit557811fe6cee5895f5755ef374dcec629b242dde (patch)
treebc5daf45018180c57b9055e69449c61a5771daf4
parent4ebb4e5565443aba22abeb025f36853a05632d9f (diff)
downloadbcm5719-llvm-557811fe6cee5895f5755ef374dcec629b242dde.tar.gz
bcm5719-llvm-557811fe6cee5895f5755ef374dcec629b242dde.zip
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. llvm-svn: 172396
-rw-r--r--clang/unittests/Format/FormatTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index b05d19c6529..2f66e5454cb 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud