]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/linkerscript/memory-data-commands.test
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / linkerscript / memory-data-commands.test
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 %t %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
12 MEMORY {
13   text (rwx): org = 0x0, len = 0x1000
14   ram (rwx): org = 0x1000, len = 8
15 }
16 SECTIONS {
17   .text : { *(.text) } > text
18   .foo : {
19     *(.foo)
20     BYTE(0x1)
21   } > ram
22 }