4 RUN: llvm-mc -filetype=obj -triple=x86_64 %ts/s -o %t.o
6 ## Check that a non-allocatable section is not assigned to a memory region by
7 ## matching the section/region properties. Previously, that could lead to an
8 ## "error: section '.nonalloc' will not fit in region 'RAM'".
10 RUN: ld.lld %t.o -T %ts/t --fatal-warnings -o /dev/null
12 ## Check that an explicit assignment is ignored for a non-allocatable section.
13 ## Previously, that also could lead to the same error.
15 RUN: ld.lld %t.o -T %ts/t2 -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN
17 WARN: warning: ignoring memory region assignment for non-allocatable section '.nonalloc'
23 ## Note: a "writable" section is used because lld does not fully support
24 ## memory region attribute "r" at the moment.
25 .section .nonalloc,"w"
31 RAM (rwx) : ORIGIN = 0x8000, LENGTH = 0x100
36 .nonalloc : { *(.nonalloc) }
42 RAM (rwx) : ORIGIN = 0x8000, LENGTH = 0x100
47 .nonalloc : { *(.nonalloc) } > RAM