1# REQUIRES: x86
2
3# RUN: echo ".section .foo,\"a\"" > %t.s
4# RUN: echo ".quad 1" >> %t.s
5# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t.s -o %t.o
6
7# RUN: not ld.lld -o /dev/null %t.o --script %s 2>&1 | FileCheck %s
8
9# Check we are able to catch 'ram' overflow caused by BYTE command.
10# CHECK: error: section '.foo' will not fit in region 'ram': overflowed by 1 bytes
11
12MEMORY {
13  text (rwx): org = 0x0, len = 0x1000
14  ram (rwx): org = 0x1000, len = 8
15}
16SECTIONS {
17  .text : { *(.text) } > text
18  .foo : {
19    *(.foo)
20    BYTE(0x1)
21  } > ram
22}
23