summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-28 13:21:16 +0000
committerDaniel Jasper <djasper@google.com>2013-01-28 13:21:16 +0000
commit0b41cbb5337eda65fa354fc24c22951cd77730a0 (patch)
treee994ec6dba04114193fd0a751c494b2a740ce556 /clang/unittests/Format/FormatTest.cpp
parentca6623b9e3ab292558837b0543e4ab2ac147eb3b (diff)
downloadbcm5719-llvm-0b41cbb5337eda65fa354fc24c22951cd77730a0.tar.gz
bcm5719-llvm-0b41cbb5337eda65fa354fc24c22951cd77730a0.zip
Initial support for formatting range-based for-loops.
Before (in good cases): for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {} for (auto aaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaa)) {} After: for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {} for (auto aaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaa)) {} llvm-svn: 173684
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 240ce1aeadf..c1430193eb6 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -241,6 +241,13 @@ TEST_F(FormatTest, FormatsForLoop) {
" ++IIIII) {\n}");
}
+TEST_F(FormatTest, RangeBasedForLoops) {
+ verifyFormat("for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa :\n"
+ " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {\n}");
+ verifyFormat("for (auto aaaaaaaaaaaaaaaaaaaaa :\n"
+ " aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaa, aaaaaaaaaaaaa)) {\n}");
+}
+
TEST_F(FormatTest, FormatsWhileLoop) {
verifyFormat("while (true) {\n}");
verifyFormat("while (true)\n"
OpenPOWER on IntegriCloud