Index: test/tools/yaml2obj/invalid_output_file.test =================================================================== --- /dev/null +++ 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: tools/yaml2obj/yaml2obj.cpp =================================================================== --- tools/yaml2obj/yaml2obj.cpp +++ tools/yaml2obj/yaml2obj.cpp @@ -80,7 +80,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; }