Index: llvm/trunk/test/tools/yaml2obj/invalid_output_file.test =================================================================== --- llvm/trunk/test/tools/yaml2obj/invalid_output_file.test +++ llvm/trunk/test/tools/yaml2obj/invalid_output_file.test @@ -0,0 +1,4 @@ +# RUN: not yaml2obj -o %p/path/does/not/exist 2>&1 | FileCheck %s + +# Don't check the OS-dependent message "No such file or directory". +# CHECK: yaml2obj: Error opening '{{.*}}/path/does/not/exist': {{.*}} Index: llvm/trunk/tools/yaml2obj/yaml2obj.cpp =================================================================== --- llvm/trunk/tools/yaml2obj/yaml2obj.cpp +++ llvm/trunk/tools/yaml2obj/yaml2obj.cpp @@ -82,7 +82,8 @@ std::unique_ptr Out( new tool_output_file(OutputFilename, EC, sys::fs::F_None)); if (EC) { - errs() << EC.message() << '\n'; + errs() << "yaml2obj: Error opening '" << OutputFilename + << "': " + EC.message() << "\n"; return 1; }