summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/unused-synthetic2.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/linkerscript/unused-synthetic2.test')
-rw-r--r--test/ELF/linkerscript/unused-synthetic2.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/unused-synthetic2.test b/test/ELF/linkerscript/unused-synthetic2.test
new file mode 100644
index 0000000000000..755d1af00be0f
--- /dev/null
+++ b/test/ELF/linkerscript/unused-synthetic2.test
@@ -0,0 +1,12 @@
+# REQUIRES: arm
+# RUN: llvm-mc -filetype=obj -triple=armv7-unknown-linux-gnueabi /dev/null -o %t.o
+
+## We incorrectly removed unused synthetic sections and crashed before.
+## Check we do not crash and do not produce .trap output section.
+# RUN: ld.lld -shared -o %t.so --script %s %t.o
+# RUN: llvm-objdump -section-headers %t.so | FileCheck %s
+# CHECK-NOT: .trap
+
+SECTIONS {
+ .trap : { *(.ARM.exidx) *(.dummy) }
+}