From: Davide Italiano Date: Sat, 19 Sep 2015 20:49:34 +0000 (+0000) Subject: [obj2yaml] Fix "time of check to time of use" bug. Add a test. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=e986a9d52e5e340c06eb6b33c6d9bb2a6b9a9159 [obj2yaml] Fix "time of check to time of use" bug. Add a test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248096 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Object/obj2yaml.test b/test/Object/obj2yaml.test index 8054b23eb56..64ddaf4fb74 100644 --- a/test/Object/obj2yaml.test +++ b/test/Object/obj2yaml.test @@ -414,3 +414,6 @@ ELF-X86-64-UNWIND-NEXT: Type: SHT_X86_64_UNWIND ELF-X86-64-UNWIND-NEXT: Flags: [ SHF_ALLOC ] ELF-X86-64-UNWIND-NEXT: AddressAlign: 0x0000000000000001 ELF-X86-64-UNWIND-NEXT: Content: '' + +RUN: not llvm-cxxdump %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s +ENOENT: {{.*}}.blah: {{[Nn]}}o such file or directory diff --git a/tools/obj2yaml/obj2yaml.cpp b/tools/obj2yaml/obj2yaml.cpp index b64096d75fa..ee6284da6e4 100644 --- a/tools/obj2yaml/obj2yaml.cpp +++ b/tools/obj2yaml/obj2yaml.cpp @@ -29,9 +29,6 @@ static std::error_code dumpObject(const ObjectFile &Obj) { } static std::error_code dumpInput(StringRef File) { - if (File != "-" && !sys::fs::exists(File)) - return obj2yaml_error::file_not_found; - ErrorOr> BinaryOrErr = createBinary(File); if (std::error_code EC = BinaryOrErr.getError()) return EC;