[llvm] r248096 - [obj2yaml] Fix "time of check to time of use" bug. Add a test.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 19 13:49:34 PDT 2015


Author: davide
Date: Sat Sep 19 15:49:34 2015
New Revision: 248096

URL: http://llvm.org/viewvc/llvm-project?rev=248096&view=rev
Log:
[obj2yaml] Fix "time of check to time of use" bug. Add a test.

Modified:
    llvm/trunk/test/Object/obj2yaml.test
    llvm/trunk/tools/obj2yaml/obj2yaml.cpp

Modified: llvm/trunk/test/Object/obj2yaml.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/obj2yaml.test?rev=248096&r1=248095&r2=248096&view=diff
==============================================================================
--- llvm/trunk/test/Object/obj2yaml.test (original)
+++ llvm/trunk/test/Object/obj2yaml.test Sat Sep 19 15:49:34 2015
@@ -414,3 +414,6 @@ ELF-X86-64-UNWIND-NEXT:   Type:
 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

Modified: llvm/trunk/tools/obj2yaml/obj2yaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/obj2yaml.cpp?rev=248096&r1=248095&r2=248096&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/obj2yaml.cpp (original)
+++ llvm/trunk/tools/obj2yaml/obj2yaml.cpp Sat Sep 19 15:49:34 2015
@@ -29,9 +29,6 @@ static std::error_code dumpObject(const
 }
 
 static std::error_code dumpInput(StringRef File) {
-  if (File != "-" && !sys::fs::exists(File))
-    return obj2yaml_error::file_not_found;
-
   ErrorOr<OwningBinary<Binary>> BinaryOrErr = createBinary(File);
   if (std::error_code EC = BinaryOrErr.getError())
     return EC;




More information about the llvm-commits mailing list