diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-23 14:08:21 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-23 14:08:21 +0000 |
commit | a32a7fda316289dca6aac1352fde3caf14a1cb2f (patch) | |
tree | dab48dbe824f0b6323ec80ef704572cf0c324a36 /unittests/Format/FormatTest.cpp | |
parent | 20d3583857c2cc99dcc9c27ff5f23916df9c0812 (diff) |
Fixes layouting regression and invalid-read.
Layouting would prevent breaking before + in
a[b + c] = d;
Regression detected by code review.
Also fixes an invalid-read found by the valgrind bot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173262 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index d1af838a73..806a7eb9c0 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1365,6 +1365,13 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) { verifyGoogleFormat("A = new SomeType* [Length]();"); } +TEST_F(FormatTest, FormatsBinaryOperatorsPrecedingEquals) { + verifyFormat("void f() {\n" + " x[aaaaaaaaa -\n" + " b] = 23;\n" + "}", getLLVMStyleWithColumns(15)); +} + TEST_F(FormatTest, FormatsCasts) { verifyFormat("Type *A = static_cast<Type *>(P);"); verifyFormat("Type *A = (Type *)P;"); |