; RUN: env TZ=GMT llvm-ar tv %t.a | FileCheck %s
CHECK: 1465 2004-11-19 03:01:31.000000000 very_long_bytecode_file_name.bc
+
+
+RUN: not llvm-ar x %p/Inputs/GNU.a foo.o 2>&1 | FileCheck --check-prefix=NOTFOUND %s
+NOTFOUND: foo.o was not found
static void performReadOperation(ArchiveOperation Operation,
object::Archive *OldArchive) {
+ bool Filter = !Members.empty();
for (const object::Archive::Child &C : OldArchive->children()) {
ErrorOr<StringRef> NameOrErr = C.getName();
failIfError(NameOrErr.getError());
StringRef Name = NameOrErr.get();
- if (!Members.empty() &&
- std::find(Members.begin(), Members.end(), Name) == Members.end())
- continue;
+ if (Filter) {
+ auto I = std::find(Members.begin(), Members.end(), Name);
+ if (I == Members.end())
+ continue;
+ Members.erase(I);
+ }
switch (Operation) {
default:
break;
}
}
+ if (Members.empty())
+ return;
+ for (StringRef Name : Members)
+ errs() << Name << " was not found\n";
+ std::exit(1);
}
template <typename T>