blob: b18a7ee037a3f61bfcd9eeab76c36482ff36e3d3 [file] [log] [blame]
# 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
## Non-empty include file.
# RUN: echo "QUAD(0)" > %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 00000010 0000000000002000 DATA
MEMORY {
ROM (rwx): ORIGIN = 0x1000, LENGTH = 0x100
RAM (rwx): ORIGIN = 0x2000, LENGTH = 0x100
}
SECTIONS {
.text : { *(.text*) } > ROM
.data : {
*(.data*)
INCLUDE "output-section-include.test.tmp.inc"
} > RAM
}