From 1b6f4bd8d7e75e775053b1cb1281c6a127746e93 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Mon, 14 Jan 2013 10:58:01 +0000 Subject: [PATCH] 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 --- unittests/Format/FormatTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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 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) { -- 2.40.0