]> granicus.if.org Git - clang/commitdiff
[arcmt] Add a test case for r138671 and improve the loop.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 26 Aug 2011 23:20:23 +0000 (23:20 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 26 Aug 2011 23:20:23 +0000 (23:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138674 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ARCMigrate/FileRemapper.cpp
test/ARCMT/migrate-space-in-path.m [new file with mode: 0644]

index e255e40c19c869dc4ef1692485d484924afd68d9..33a1db4d8376aa2c6659aa7d586644377315e540 100644 (file)
@@ -68,8 +68,7 @@ bool FileRemapper::initFromDisk(StringRef outputDir, Diagnostic &Diag,
   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 @@ bool FileRemapper::initFromDisk(StringRef outputDir, Diagnostic &Diag,
     }
 
     pairs.push_back(std::make_pair(origFE, newFE));
-
-    idx += 3;
   }
 
   for (unsigned i = 0, e = pairs.size(); i != e; ++i)
diff --git a/test/ARCMT/migrate-space-in-path.m b/test/ARCMT/migrate-space-in-path.m
new file mode 100644 (file)
index 0000000..1e2f638
--- /dev/null
@@ -0,0 +1,7 @@
+// RUN: mkdir -p %t/"with space"
+// RUN: cp %S/Inputs/* %t/"with space"
+// RUN: %clang_cc1 -arcmt-migrate -arcmt-migrate-directory %t.migrate %t/"with space"/test1.m.in -x objective-c -fobjc-nonfragile-abi
+// RUN: %clang_cc1 -arcmt-migrate -arcmt-migrate-directory %t.migrate %t/"with space"/test2.m.in -x objective-c -fobjc-nonfragile-abi
+// RUN: c-arcmt-test -arcmt-migrate-directory %t.migrate | arcmt-test -verify-transformed-files %t/"with space"/test1.m.in.result %t/"with space"/test2.m.in.result %t/"with space"/test.h.result
+// RUN: rm -rf %t.migrate
+// RUN: rm -rf %t