diff options
author | Daniel Jasper <djasper@google.com> | 2013-02-03 18:07:15 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-02-03 18:07:15 +0000 |
commit | 1ca05ccf68e856519e538d585918aa227d9b253d (patch) | |
tree | 54fd270651e6a7bd30ecae1c82b10e9fcf2a891a /clang/unittests/Format/FormatTest.cpp | |
parent | 2aedfbd1775d83132082c4341278fe0cdd41fdf1 (diff) | |
download | bcm5719-llvm-1ca05ccf68e856519e538d585918aa227d9b253d.tar.gz bcm5719-llvm-1ca05ccf68e856519e538d585918aa227d9b253d.zip |
Fix bug in formatting of nested initializers.
We can now format:
SomeArrayOfSomeType a = { { { 1, 2, 3 } }, { { 1, 2, 3 } },
{ { 111111111111111111111111111111,
222222222222222222222222222222,
333333333333333333333333333333 } },
{ { 1, 2, 3 } }, { { 1, 2, 3 } } };
Before, we did strange things there.
llvm-svn: 174291
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index bffbbf53316..ef97df951ab 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -693,6 +693,12 @@ TEST_F(FormatTest, NestedStaticInitializers) { " 222222222222222222222222222222,\n" " 333333333333333333333333333333 },\n" " { 1, 2, 3 }, { 1, 2, 3 } } };"); + verifyFormat( + "SomeArrayOfSomeType a = { { { 1, 2, 3 } }, { { 1, 2, 3 } },\n" + " { { 111111111111111111111111111111,\n" + " 222222222222222222222222222222,\n" + " 333333333333333333333333333333 } },\n" + " { { 1, 2, 3 } }, { { 1, 2, 3 } } };"); // FIXME: We might at some point want to handle this similar to parameter // lists, where we have an option to put each on a single line. |