]> granicus.if.org Git - clang/commitdiff
Adds some more tests for * and &.
authorManuel Klimek <klimek@google.com>
Mon, 14 Jan 2013 10:58:01 +0000 (10:58 +0000)
committerManuel Klimek <klimek@google.com>
Mon, 14 Jan 2013 10:58:01 +0000 (10:58 +0000)
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

unittests/Format/FormatTest.cpp

index b05d19c6529b72a50372e4f9c57bbb1749bc540a..2f66e5454cb3b4d8f23ef78ff525c5a2a3de0328 100644 (file)
@@ -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) {