[arcmt] Add a test case for r138671 and improve the loop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138674 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ARCMigrate/FileRemapper.cpp b/lib/ARCMigrate/FileRemapper.cpp
index e255e40..33a1db4 100644
--- a/lib/ARCMigrate/FileRemapper.cpp
+++ b/lib/ARCMigrate/FileRemapper.cpp
@@ -68,8 +68,7 @@
   SmallVector<StringRef, 64> lines;
   fileBuf->getBuffer().split(lines, "\n");
 
-  unsigned idx = 0;
-  while (idx+3 <= lines.size()) {
+  for (unsigned idx = 0; idx+3 <= lines.size(); idx += 3) {
     std::string fromFilename = lines[idx];
     uint64_t timeModified;
     lines[idx+1].getAsInteger(10, timeModified);
@@ -95,8 +94,6 @@
     }
 
     pairs.push_back(std::make_pair(origFE, newFE));
-
-    idx += 3;
   }
 
   for (unsigned i = 0, e = pairs.size(); i != e; ++i)