summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-01-21 21:13:27 +0000
committerKevin Enderby <enderby@apple.com>2016-01-21 21:13:27 +0000
commit1f472eace5207f41e55953d62cc9c5b0dab31eba (patch)
treef45739dbacda44119f006be74a9241afdf092711 /llvm/test
parentf0a275e0358911794545810b96c5d160e7bd714f (diff)
downloadbcm5719-llvm-1f472eace5207f41e55953d62cc9c5b0dab31eba.tar.gz
bcm5719-llvm-1f472eace5207f41e55953d62cc9c5b0dab31eba.zip
Fix MachOObjectFile::getSymbolSection() 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 "(?,?)" or just "s" for bad section indexes. Also added a test to show it prints the bad section index of "42" when printing the fields as raw hex. llvm-svn: 258434
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Object/macho-invalid.test10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test
index f4aa1e0c298..686e516f5e9 100644
--- a/llvm/test/Object/macho-invalid.test
+++ b/llvm/test/Object/macho-invalid.test
@@ -31,9 +31,15 @@ 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
-RUN: not llvm-nm %p/Inputs/macho-invalid-section-index-getSectionRawName 2>&1 \
+RUN: llvm-nm %p/Inputs/macho-invalid-section-index-getSectionRawName 2>&1 \
RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-SYMBOL-SEC %s
-INVALID-SECTION-IDX-SYMBOL-SEC: getSymbolSection: Invalid section index
+INVALID-SECTION-IDX-SYMBOL-SEC: 0000000100000000 S __mh_execute_header
+RUN: llvm-nm -m %p/Inputs/macho-invalid-section-index-getSectionRawName 2>&1 \
+RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-SYMBOL-SEC-m %s
+INVALID-SECTION-IDX-SYMBOL-SEC-m: 0000000100000000 (?,?) [referenced dynamically] external __mh_execute_header
+RUN: llvm-nm -pax %p/Inputs/macho-invalid-section-index-getSectionRawName 2>&1 \
+RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-SYMBOL-SEC-pax %s
+INVALID-SECTION-IDX-SYMBOL-SEC-pax: 0000000100000000 0f 42 0010 00000065 __mh_execute_header
RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-header 2>&1 | FileCheck -check-prefix INVALID-HEADER %s
INVALID-HEADER: Invalid data was encountered while parsing the file
OpenPOWER on IntegriCloud