diff options
author | Daniel Jasper <djasper@google.com> | 2014-08-14 10:53:19 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-08-14 10:53:19 +0000 |
commit | 1904e9b98dca626166f99f62fa78fae30f6fa0f4 (patch) | |
tree | 7e3224face2bb09f583093d051be95a86ca05464 /clang/unittests/Format/FormatTest.cpp | |
parent | 78b4533acfd23a8944d0b5d3510e13b79a36805f (diff) | |
download | bcm5719-llvm-1904e9b98dca626166f99f62fa78fae30f6fa0f4.tar.gz bcm5719-llvm-1904e9b98dca626166f99f62fa78fae30f6fa0f4.zip |
clang-format: Support chained dereferenced assignments.
Before:
x = * a(x) = *a(y);
After:
x = *a(x) = *a(y);
llvm-svn: 215632
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index a10b4d7fb62..c59201f6119 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -4823,6 +4823,10 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) { "const char* const p = reinterpret_cast<const char* const>(q);"); verifyGoogleFormat("void f(int i = 0, SomeType** temps = NULL);"); + FormatStyle Left = getLLVMStyle(); + Left.PointerAlignment = FormatStyle::PAS_Left; + verifyFormat("x = *a(x) = *a(y);", Left); + verifyIndependentOfContext("a = *(x + y);"); verifyIndependentOfContext("a = &(x + y);"); verifyIndependentOfContext("*(x + y).call();"); |