summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object/macho-invalid.test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-05-03 23:13:50 +0000
committerKevin Enderby <enderby@apple.com>2016-05-03 23:13:50 +0000
commita8e3ab0c5675d0e51b5643146fd634cf9608b6f4 (patch)
treec4efc6156f51a1044026b06e1f8cec7f85b92792 /llvm/test/Object/macho-invalid.test
parentfedce46bbdbb781c4d0a1e74cf93a1f563f3129d (diff)
downloadbcm5719-llvm-a8e3ab0c5675d0e51b5643146fd634cf9608b6f4.tar.gz
bcm5719-llvm-a8e3ab0c5675d0e51b5643146fd634cf9608b6f4.zip
Produce another specific error message for a malformed Mach-O file when a load
command has a size less than 8 bytes. I think the existing test case in test/Object/macho-invalid.test for macho64-invalid-too-small-load-command was trying to test for this but that test case triggered a different error given how it was constructed. So I constructed a new test case that would trigger this specific error. I also changed the error message to be consistent with the other malformed Mach-O file error messages. I also removed object_error::macho_small_load_command from Object/Error.h as it is not needed and can just use object_error::parse_failed and let the error message string distinguish the error. llvm-svn: 268463
Diffstat (limited to 'llvm/test/Object/macho-invalid.test')
-rw-r--r--llvm/test/Object/macho-invalid.test4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test
index 92b18079b5d..4ddea18fedf 100644
--- a/llvm/test/Object/macho-invalid.test
+++ b/llvm/test/Object/macho-invalid.test
@@ -19,6 +19,10 @@ RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho64-invalid-too-smal
RUN: | FileCheck -check-prefix SMALL-LOADC-SIZE %s
SMALL-LOADC-SIZE: truncated or malformed object (load commands extend past the end of the file)
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho64-invalid-too-small-load-command.1 2>&1 \
+RUN: | FileCheck -check-prefix SMALL-LOADC-SIZE-1 %s
+SMALL-LOADC-SIZE-1: truncated or malformed object (load command 1 with size less than 8 bytes)
+
RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-too-small-segment-load-command 2>&1 \
RUN: | FileCheck -check-prefix SMALL-SEGLOADC-SIZE %s
RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-too-small-segment-load-command 2>&1 \
OpenPOWER on IntegriCloud