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
13## Non-empty include file.
14# RUN: echo "QUAD(0)" > %t.inc
15# RUN: ld.lld -o %t.elf --script %s %t.o -L %T
16# RUN: llvm-objdump -section-headers %t.elf | FileCheck %s --check-prefix=CHECK2
17# CHECK2: .data         00000010 0000000000002000 DATA
18
19MEMORY {
20  ROM (rwx): ORIGIN = 0x1000, LENGTH = 0x100
21  RAM (rwx): ORIGIN = 0x2000, LENGTH = 0x100
22}
23
24SECTIONS {
25  .text : { *(.text*) } > ROM
26  .data : {
27    *(.data*)
28    INCLUDE "output-section-include.test.tmp.inc"
29  } > RAM
30}
31