aboutsummaryrefslogtreecommitdiffstats
path: root/test/ELF/linkerscript/memory-include.test
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-11-04 14:42:21 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-11-04 14:42:21 +0000
commitd08c35566595bf29a50e39cbaaf32188ede63f7a (patch)
tree8e0d582dbfb68a3bf01decdab787004fde19f3de /test/ELF/linkerscript/memory-include.test
parentebe7d41024f3c7f5adddb6a1ff1d0d3361f58c1c (diff)
downloadsrc-vendor/lld-70.tar.gz
src-vendor/lld-70.zip
Notes
Notes: svn path=/vendor/lld/dist-release_70/; revision=340122 svn path=/vendor/lld/lld-release_701-r349250/; revision=342121; tag=vendor/lld/lld-release_701-r349250
Diffstat (limited to 'test/ELF/linkerscript/memory-include.test')
-rw-r--r--test/ELF/linkerscript/memory-include.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/memory-include.test b/test/ELF/linkerscript/memory-include.test
new file mode 100644
index 000000000000..340328225bde
--- /dev/null
+++ b/test/ELF/linkerscript/memory-include.test
@@ -0,0 +1,23 @@
+# REQUIRES: x86
+
+# RUN: echo '.section .text,"ax"; .global _start; nop' > %t.s
+# RUN: echo '.section .data,"aw"; .quad 0' >> %t.s
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t.s -o %t.o
+
+# RUN: echo "RAM2 (rwx): ORIGIN = 0x3000, LENGTH = 0x100" > %t.inc
+# RUN: ld.lld -o %t.elf --script %s %t.o -L %T
+# RUN: llvm-objdump -section-headers %t.elf | FileCheck %s
+# CHECK: .data 00000008 0000000000002000 DATA
+# CHECK: .data2 00000008 0000000000003000 DATA
+
+MEMORY {
+ ROM (rwx): ORIGIN = 0x1000, LENGTH = 0x100
+ RAM (rwx): ORIGIN = 0x2000, LENGTH = 0x100
+ INCLUDE "memory-include.test.tmp.inc"
+}
+
+SECTIONS {
+ .text : { *(.text*) } > ROM
+ .data : { *(.data*) } > RAM
+ .data2 : { QUAD(0) } > RAM2
+}