From d08c35566595bf29a50e39cbaaf32188ede63f7a Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 4 Nov 2018 14:42:21 +0000 Subject: Vendor import of lld release_70 branch r346007: https://llvm.org/svn/llvm-project/lld/branches/release_70@346007 --- test/ELF/linkerscript/section-include.test | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/ELF/linkerscript/section-include.test (limited to 'test/ELF/linkerscript/section-include.test') diff --git a/test/ELF/linkerscript/section-include.test b/test/ELF/linkerscript/section-include.test new file mode 100644 index 000000000000..9b6dfa0dcc4e --- /dev/null +++ b/test/ELF/linkerscript/section-include.test @@ -0,0 +1,32 @@ +# 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 + +## Empty include file. +# RUN: echo "" > %t.inc +# RUN: ld.lld -o %t.elf --script %s %t.o -L %T +# RUN: llvm-objdump -section-headers %t.elf | FileCheck %s --check-prefix=CHECK1 +# CHECK1: .data 00000008 0000000000002000 DATA +# CHECK1-NEXT: .data3 00000008 0000000000002008 DATA + +## Non-empty include file. +# RUN: echo ".data2 : { QUAD(0) } > RAM" > %t.inc +# RUN: ld.lld -o %t.elf --script %s %t.o -L %T +# RUN: llvm-objdump -section-headers %t.elf | FileCheck %s --check-prefix=CHECK2 +# CHECK2: .data 00000008 0000000000002000 DATA +# CHECK2-NEXT: .data2 00000008 0000000000002008 DATA +# CHECK2-NEXT: .data3 00000008 0000000000002010 DATA + +MEMORY { + ROM (rwx): ORIGIN = 0x1000, LENGTH = 0x100 + RAM (rwx): ORIGIN = 0x2000, LENGTH = 0x100 +} + +SECTIONS { + .text : { *(.text*) } > ROM + .data : { *(.data*) } > RAM + INCLUDE "section-include.test.tmp.inc" + .data3 : { QUAD(0) } > RAM +} -- cgit v1.3