summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-09-29 17:45:23 +0000
committerKevin Enderby <enderby@apple.com>2016-09-29 17:45:23 +0000
commit245be3ed2ab4f49df8f7508d8251575720e7fd4d (patch)
tree8e35da56ac5f4ef620abdbb4c232141ff488daee /llvm/test/Object
parenta9b0dd0e5138aa0c48047bcbd75c9ee76767d11f (diff)
downloadbcm5719-llvm-245be3ed2ab4f49df8f7508d8251575720e7fd4d.tar.gz
bcm5719-llvm-245be3ed2ab4f49df8f7508d8251575720e7fd4d.zip
Next set of additional error checks for invalid Mach-O files for the
load command that uses the Mach::source_version_command type but not used in llvm libObject code but used in llvm tool code. This includes just the LC_SOURCE_VERSION load command. llvm-svn: 282736
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-source-bad-sizebin0 -> 48 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-source-more-than-onebin0 -> 60 bytes
-rw-r--r--llvm/test/Object/macho-invalid.test6
3 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/macho-invalid-source-bad-size b/llvm/test/Object/Inputs/macho-invalid-source-bad-size
new file mode 100644
index 00000000000..5c09e421d7b
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-source-bad-size
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-source-more-than-one b/llvm/test/Object/Inputs/macho-invalid-source-more-than-one
new file mode 100644
index 00000000000..148565bda6a
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-source-more-than-one
Binary files differ
diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test
index c4048db23b6..c7d7b05d5da 100644
--- a/llvm/test/Object/macho-invalid.test
+++ b/llvm/test/Object/macho-invalid.test
@@ -322,3 +322,9 @@ INVALID-RPATH-NAME_OFFSET-TOOBIG: macho-invalid-rpath-name_offset-toobig': trunc
RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-rpath-name_toobig 2>&1 | FileCheck -check-prefix INVALID-RPATH-NAME_TOOBIG %s
INVALID-RPATH-NAME_TOOBIG: macho-invalid-rpath-name_toobig': truncated or malformed object (load command 0 LC_RPATH library name extends past the end of the load command)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-source-bad-size 2>&1 | FileCheck -check-prefix INVALID-SOURCE-BAD-SIZE %s
+INVALID-SOURCE-BAD-SIZE: macho-invalid-source-bad-size': truncated or malformed object (LC_SOURCE_VERSION command 0 has incorrect cmdsize)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-source-more-than-one 2>&1 | FileCheck -check-prefix INVALID-SOURCE-MORE-THAN-ONE %s
+INVALID-SOURCE-MORE-THAN-ONE: macho-invalid-source-more-than-one': truncated or malformed object (more than one LC_SOURCE_VERSION command)
OpenPOWER on IntegriCloud