2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4 ## The definitions of symbol assignments may reference other symbols.
5 ## Test we can handle them.
7 # RUN: echo "SECTIONS { aaa = foo | 1; .text : { *(.text*) } }" > %t3.script
8 # RUN: ld.lld -o %t --script %t3.script %t.o
9 # RUN: llvm-nm -p %t | FileCheck --check-prefix=VAL1 %s
11 # VAL1: 0000000000000000 T foo
12 # VAL1: 0000000000000001 T aaa
14 # RUN: echo "SECTIONS { aaa = ABSOLUTE(foo - 1) + 1; .text : { *(.text*) } }" > %t.script
15 # RUN: ld.lld -o %t --script %t.script %t.o
16 # RUN: llvm-nm -p %t | FileCheck --check-prefix=VAL %s
18 # RUN: echo "SECTIONS { aaa = 1 + ABSOLUTE(foo - 1); .text : { *(.text*) } }" > %t.script
19 # RUN: ld.lld -o %t --script %t.script %t.o
20 # RUN: llvm-nm -p %t | FileCheck --check-prefix=VAL %s
22 # RUN: echo "SECTIONS { aaa = ABSOLUTE(foo); .text : { *(.text*) } }" > %t4.script
23 # RUN: ld.lld -o %t --script %t4.script %t.o
24 # RUN: llvm-nm -p %t | FileCheck --check-prefix=VAL %s
26 # VAL: 0000000000000000 T foo
27 # VAL: 0000000000000000 A aaa