Files
clang-p2996/lld/test/ELF/linkerscript/memory-include.test
Fangrui Song db8dad20b3 [ELF][test] Change references of %T to %t.dir
Test files in the same directory share the same %T.  %T is easy to
misuse and cause race conditions (when running concurrently) so it has
been deprecated since D48842 (see docs/CommandGuide/lit.rst).

While here, add `rm -rf %t.dir` so that tests cannot depend on old files lying around.

Reviewed By: jhenderson, ruiu

Differential Revision: https://reviews.llvm.org/D69572
2019-10-30 09:22:48 -07:00

25 lines
767 B
Plaintext

# 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: rm -rf %t.dir && mkdir -p %t.dir
# RUN: echo "RAM2 (rwx): ORIGIN = 0x3000, LENGTH = 0x100" > %t.dir/inc.script
# RUN: ld.lld -o %t.elf --script %s %t.o -L %t.dir
# 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 "inc.script"
}
SECTIONS {
.text : { *(.text*) } > ROM
.data : { *(.data*) } > RAM
.data2 : { QUAD(0) } > RAM2
}