summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-07-31 08:12:01 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-07-31 08:12:01 +0000
commitd65c166e35dbc3432d7b3ad5a7eb6fe7b9e7e211 (patch)
treea1fba9dcece1f4913add47489379c212b9ca7194 /llvm/test/Object
parent2200a9bdf351914d8d8c68cea966a9aec50ec0fd (diff)
downloadbcm5719-llvm-d65c166e35dbc3432d7b3ad5a7eb6fe7b9e7e211.tar.gz
bcm5719-llvm-d65c166e35dbc3432d7b3ad5a7eb6fe7b9e7e211.zip
[llvm/Object] - Add a test for "empty string table" error.
This error was never tested. In this patch I improved the error message, added the test case and also simplified the code that processes a similar error right below. Differential revision: https://reviews.llvm.org/D65396 llvm-svn: 367391
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/invalid.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index 5fe107ff268..7071dee98eb 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -606,3 +606,24 @@ FileHeader:
Type: ET_REL
Machine: EM_X86_64
SHOffset: 0xffffffffffffffff
+
+## Check that llvm-objdump reports an error when it tries to dump a
+## symbol name and .strtab is empty.
+
+# RUN: yaml2obj %s --docnum=29 -o %t29
+# RUN: not llvm-objdump -syms %t29 2>&1 | FileCheck -DFILE=%t29 --check-prefix=STRTAB-EMPTY2 %s
+
+# STRTAB-EMPTY2: error: '[[FILE]]': SHT_STRTAB string table section [index 1] is empty
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+ Machine: EM_X86_64
+Sections:
+ - Name: .strtab
+ Type: SHT_STRTAB
+ Content: ""
+Symbols:
+ - Name: foo
OpenPOWER on IntegriCloud