summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-06-28 13:24:39 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-06-28 13:24:39 +0000
commit63feb1662785b23929d3a8a1a50e3f414466b4ec (patch)
tree0ae2260ce61b2cee5653c71a68f62b32a74e5cc5
parent269eb21e1ce3e8f0054f0b22a189cf9534c8ce8b (diff)
downloadbcm5719-llvm-63feb1662785b23929d3a8a1a50e3f414466b4ec.tar.gz
bcm5719-llvm-63feb1662785b23929d3a8a1a50e3f414466b4ec.zip
[ELF] - EhFrame.cpp: add test case to cover "corrupted CIE" error message.
This is to test the following line that was uncovered by LLD test cases yet: https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L149 llvm-svn: 335852
-rw-r--r--lld/test/ELF/invalid-eh-frame8.s30
1 files changed, 30 insertions, 0 deletions
diff --git a/lld/test/ELF/invalid-eh-frame8.s b/lld/test/ELF/invalid-eh-frame8.s
new file mode 100644
index 00000000000..6a60959cffe
--- /dev/null
+++ b/lld/test/ELF/invalid-eh-frame8.s
@@ -0,0 +1,30 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: not ld.lld --eh-frame-hdr %t -o %t2 2>&1 | FileCheck %s
+
+# CHECK: error: corrupted .eh_frame: corrupted CIE
+
+.section .eh_frame
+ .byte 0x0E
+ .byte 0x00
+ .byte 0x00
+ .byte 0x00
+ .byte 0x00
+ .byte 0x00
+ .byte 0x00
+ .byte 0x00
+ .byte 0x01
+
+ .byte 0x50 # Augmentation string: 'P','\0'
+ .byte 0x00
+
+ .byte 0x01
+
+ .byte 0x01 # LEB128
+ .byte 0x01 # LEB128
+
+ .byte 0x03
+ .byte 0x01
+ .byte 0x01
+ .byte 0x01
OpenPOWER on IntegriCloud