summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/test/tools/llvm-size/basic.test2
-rw-r--r--llvm/tools/llvm-size/llvm-size.cpp8
2 files changed, 2 insertions, 8 deletions
diff --git a/llvm/test/tools/llvm-size/basic.test b/llvm/test/tools/llvm-size/basic.test
new file mode 100644
index 00000000000..89a38098b0e
--- /dev/null
+++ b/llvm/test/tools/llvm-size/basic.test
@@ -0,0 +1,2 @@
+RUN: llvm-size %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
+ENOENT: {{.*}}llvm-size: {{.*}}.blah: {{[Nn]}}o such file or directory
diff --git a/llvm/tools/llvm-size/llvm-size.cpp b/llvm/tools/llvm-size/llvm-size.cpp
index 9a6e2c1ae4b..de2b0450523 100644
--- a/llvm/tools/llvm-size/llvm-size.cpp
+++ b/llvm/tools/llvm-size/llvm-size.cpp
@@ -413,14 +413,6 @@ static bool checkMachOAndArchFlags(ObjectFile *o, StringRef file) {
/// @brief Print the section sizes for @p file. If @p file is an archive, print
/// the section sizes for each archive member.
static void PrintFileSectionSizes(StringRef file) {
- // If file is not stdin, check that it exists.
- if (file != "-") {
- if (!sys::fs::exists(file)) {
- errs() << ToolName << ": '" << file << "': "
- << "No such file\n";
- return;
- }
- }
// Attempt to open the binary.
ErrorOr<OwningBinary<Binary>> BinaryOrErr = createBinary(file);
OpenPOWER on IntegriCloud