summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object/macho-invalid.test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-01-22 18:47:14 +0000
committerKevin Enderby <enderby@apple.com>2016-01-22 18:47:14 +0000
commitf681ec5db15fc039d3c94ac03032f7b87788160d (patch)
tree428d3a39f901f7513cf8badb4b2a4e32cee936ba /llvm/test/Object/macho-invalid.test
parentae108c47043a93b0cb3c775ebe79588324c305d6 (diff)
downloadbcm5719-llvm-f681ec5db15fc039d3c94ac03032f7b87788160d.tar.gz
bcm5719-llvm-f681ec5db15fc039d3c94ac03032f7b87788160d.zip
Fix MachOObjectFile::getSymbolName() to not call report_fatal_error()
but to return object_error::parse_failed.  Then made the code in llvm-nm do for Mach-O files what is done in the darwin native tools which is to print "bad string index" for bad string indexes. Updated the error message in the llvm-objdump test, and added tests to show llvm-nm prints "bad string index" and a test to print the actual bad string index value which in this case is 0xfe000002 when printing the fields as raw hex. llvm-svn: 258520
Diffstat (limited to 'llvm/test/Object/macho-invalid.test')
-rw-r--r--llvm/test/Object/macho-invalid.test8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test
index 686e516f5e9..0cf264f8771 100644
--- a/llvm/test/Object/macho-invalid.test
+++ b/llvm/test/Object/macho-invalid.test
@@ -29,7 +29,13 @@ BAD-SYMBOL: Requested symbol index is out of range
RUN: not llvm-objdump -t %p/Inputs/macho-invalid-symbol-name-past-eof 2>&1 \
RUN: | FileCheck -check-prefix NAME-PAST-EOF %s
-NAME-PAST-EOF: Symbol name entry points before beginning or past end of file
+NAME-PAST-EOF: error reading file: Invalid data was encountered while parsing the file.
+RUN: llvm-nm -pa %p/Inputs/macho-invalid-symbol-name-past-eof 2>&1 \
+RUN: | FileCheck -check-prefix NAME-PAST-EOF-nm-pa %s
+NAME-PAST-EOF-nm-pa: 0000000000000000 - 00 0000 SO bad string index
+RUN: llvm-nm -pax %p/Inputs/macho-invalid-symbol-name-past-eof 2>&1 \
+RUN: | FileCheck -check-prefix NAME-PAST-EOF-nm-pax %s
+NAME-PAST-EOF-nm-pax: 0000000000000000 64 00 0000 fe000002 bad string index
RUN: llvm-nm %p/Inputs/macho-invalid-section-index-getSectionRawName 2>&1 \
RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-SYMBOL-SEC %s
OpenPOWER on IntegriCloud