diff options
author | Daniel Jasper <djasper@google.com> | 2012-12-21 14:37:20 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2012-12-21 14:37:20 +0000 |
commit | a324a0e673cf486de281c84af3f09ba58627bbd2 (patch) | |
tree | 3a78e438464d2ca56d9cca448510a1a50d6b3437 /unittests/Format/FormatTest.cpp | |
parent | bb6a7e047aefd9ba4bab3ce1dcbb7ce2e2895b07 (diff) |
Basic support for formatting for-loops.
We used to not really format them. Now we do:
for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
SE = BB->succ_end();
SI != SE; ++SI) {
This is just one example and I am sure we still mess some of them up, but it
is a step forward.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 1e92848b8e..c8088e2c0a 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -164,6 +164,15 @@ TEST_F(FormatTest, FormatsForLoop) { verifyFormat("for (;;) {\n" " f();\n" "}"); + + verifyFormat( + "for (std::vector<UnwrappedLine>::iterator I = UnwrappedLines.begin(),\n" + " E = UnwrappedLines.end();\n" + " I != E; ++I) {\n}"); + + verifyFormat( + "for (MachineFun::iterator IIII = PrevIt, EEEE = F.end(); IIII != EEEE;\n" + " ++IIIII) {\n}"); } TEST_F(FormatTest, FormatsWhileLoop) { |