summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/discard-section-err.s
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-26 20:33:45 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-26 20:33:45 +0000
commit4ea16835ba66f2240d050ffcaee44cee6c97cab9 (patch)
treed2f3d66f3352a3ec22362de0b7a5c1366fc25df8 /test/ELF/linkerscript/discard-section-err.s
parent15f7a1a3796209b21af2817fdf11ca9932165c70 (diff)
Vendor import of lld trunk r306325:vendor/lld/lld-trunk-r306325
Notes
svn path=/vendor/lld/dist/; revision=320382 svn path=/vendor/lld/lld-trunk-r306325/; revision=320383; tag=vendor/lld/lld-trunk-r306325
Diffstat (limited to 'test/ELF/linkerscript/discard-section-err.s')
-rw-r--r--test/ELF/linkerscript/discard-section-err.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/discard-section-err.s b/test/ELF/linkerscript/discard-section-err.s
new file mode 100644
index 000000000000..5d9955545d92
--- /dev/null
+++ b/test/ELF/linkerscript/discard-section-err.s
@@ -0,0 +1,23 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
+
+# RUN: echo "SECTIONS { /DISCARD/ : { *(.shstrtab) } }" > %t.script
+# RUN: not ld.lld -o %t --script %t.script %t.o 2>&1 | \
+# RUN: FileCheck -check-prefix=SHSTRTAB %s
+# SHSTRTAB: discarding .shstrtab section is not allowed
+
+# RUN: echo "SECTIONS { /DISCARD/ : { *(.dynamic) } }" > %t.script
+# RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
+# RUN: FileCheck -check-prefix=DYNAMIC %s
+# DYNAMIC: discarding .dynamic section is not allowed
+
+# RUN: echo "SECTIONS { /DISCARD/ : { *(.dynsym) } }" > %t.script
+# RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
+# RUN: FileCheck -check-prefix=DYNSYM %s
+# DYNSYM: discarding .dynsym section is not allowed
+
+# RUN: echo "SECTIONS { /DISCARD/ : { *(.dynstr) } }" > %t.script
+# RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
+# RUN: FileCheck -check-prefix=DYNSTR %s
+# DYNSTR: discarding .dynstr section is not allowed