diff options
-rw-r--r-- | lld/COFF/Driver.cpp | 3 | ||||
-rw-r--r-- | lld/test/COFF/could-not-open.test | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp index 0584c741407..4c3ad678fb7 100644 --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -1236,6 +1236,9 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) { // Read all input files given via the command line. run(); + if (errorCount()) + return; + // We should have inferred a machine type by now from the input files, but if // not we assume x64. if (Config->Machine == IMAGE_FILE_MACHINE_UNKNOWN) { diff --git a/lld/test/COFF/could-not-open.test b/lld/test/COFF/could-not-open.test new file mode 100644 index 00000000000..87f11c34e7d --- /dev/null +++ b/lld/test/COFF/could-not-open.test @@ -0,0 +1,5 @@ +RUN: not lld-link 01 2>&1 | FileCheck %s + +CHECK: could not open 01 +CHECK-NOT: /machine is not specified +CHECK-NOT: subsystem must be defined |