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

llvm-svn: 138674
This commit is contained in:
Argyrios Kyrtzidis 2011-08-26 23:20:23 +00:00
parent 6c70e58041
commit 1045430525
2 changed files with 8 additions and 4 deletions

View 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)

View File

@ -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