2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
4 # RUN: echo "MEMORY { \
5 # RUN: ram (rwx) : ORIGIN = 0x8000, LENGTH = 256K \
8 # RUN: origin = ORIGIN(ram); \
9 # RUN: length = LENGTH(ram); \
10 # RUN: end = ORIGIN(ram) + LENGTH(ram); \
12 # RUN: ld.lld -o %t1 --script %t.script %t
13 # RUN: llvm-nm -p %t1 | FileCheck %s
15 # CHECK: 0000000000008000 T _start
16 # CHECK-NEXT: 0000000000008000 A origin
17 # CHECK-NEXT: 0000000000040000 A length
18 # CHECK-NEXT: 0000000000048000 A end
20 # RUN: echo "SECTIONS { \
21 # RUN: no_exist_origin = ORIGIN(ram); \
22 # RUN: no_exist_length = LENGTH(ram); \
23 # RUN: }" > %t2.script
24 # RUN: not ld.lld -o /dev/null --script %t2.script %t 2>&1 \
25 # RUN: | FileCheck -check-prefix=ERR %s
26 # ERR: {{.*}}.script:1: memory region not defined: ram