1# REQUIRES: x86 2 3# RUN: echo '.section .text,"ax"; .global _start; nop' > %t.s 4# RUN: echo '.section .data,"aw"; .quad 0' >> %t.s 5# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t.s -o %t.o 6 7## Empty include file. 8# RUN: echo "" > %t.inc 9# RUN: ld.lld -o %t.elf --script %s %t.o -L %T 10# RUN: llvm-objdump -section-headers %t.elf | FileCheck %s --check-prefix=CHECK1 11# CHECK1: .data 00000008 0000000000002000 DATA 12# CHECK1-NEXT: .data3 00000008 0000000000002008 DATA 13 14## Non-empty include file. 15# RUN: echo ".data2 : { QUAD(0) } > RAM" > %t.inc 16# RUN: ld.lld -o %t.elf --script %s %t.o -L %T 17# RUN: llvm-objdump -section-headers %t.elf | FileCheck %s --check-prefix=CHECK2 18# CHECK2: .data 00000008 0000000000002000 DATA 19# CHECK2-NEXT: .data2 00000008 0000000000002008 DATA 20# CHECK2-NEXT: .data3 00000008 0000000000002010 DATA 21 22MEMORY { 23 ROM (rwx): ORIGIN = 0x1000, LENGTH = 0x100 24 RAM (rwx): ORIGIN = 0x2000, LENGTH = 0x100 25} 26 27SECTIONS { 28 .text : { *(.text*) } > ROM 29 .data : { *(.data*) } > RAM 30 INCLUDE "section-include.test.tmp.inc" 31 .data3 : { QUAD(0) } > RAM 32} 33