summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/discard-section.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/linkerscript/discard-section.s')
-rw-r--r--test/ELF/linkerscript/discard-section.s14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/discard-section.s b/test/ELF/linkerscript/discard-section.s
new file mode 100644
index 000000000000..a5af90806829
--- /dev/null
+++ b/test/ELF/linkerscript/discard-section.s
@@ -0,0 +1,14 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: echo "SECTIONS { /DISCARD/ : { *(.aaa*) } }" > %t.script
+# RUN: ld.lld -o %t1 --script %t.script %t
+# RUN: llvm-objdump -section-headers %t1 | FileCheck %s
+
+# CHECK-NOT: .aaa
+
+.section .aaa,"a"
+aab:
+ .quad 0
+
+.section .zzz,"a"
+ .quad aab