xref: /llvm-project/lld/test/ELF/linkerscript/memory-no-sections.test (revision 82c2fcffc27319ba4851783498de7c98335f306e)
1REQUIRES: x86
2
3## Check that we respect MEMORY commands in linker scripts without
4## SECTIONS commands.
5
6RUN: split-file %s %ts
7RUN: llvm-mc -filetype=obj -triple=x86_64 %ts/asm.s -o %t.o
8RUN: ld.lld -o %t -T %ts/script %t.o
9RUN: llvm-readelf -S %t | FileCheck %s
10
11CHECK: .text             PROGBITS        0000000000001000
12CHECK: .data             PROGBITS        0000000010000000
13
14#--- script
15
16MEMORY {
17  flash (rx!w): org = 0x1000, len = 0x3000
18  ram (rwx): org = 0x10000000, len = 0x1000
19}
20
21#--- asm.s
22
23.text
24.byte 1
25.data
26.byte 2
27