llvm-project/lld/test/ELF/linkerscript/symbol-name.test

16 lines
612 B
Plaintext

# REQUIRES: x86
## Test that ., $ and " can be used by symbol names in expressions.
# RUN: llvm-mc -filetype=obj -triple=x86_64 /dev/null -o %t.o
# RUN: ld.lld -T %s %t.o -o %t
# RUN: llvm-readelf -s %t | FileCheck %s
# CHECK: Value Size Type Bind Vis Ndx Name
# CHECK-DAG: 0000000000000000 0 NOTYPE GLOBAL DEFAULT ABS a1
# CHECK-DAG: 0000000000000000 0 NOTYPE GLOBAL DEFAULT ABS a0
# CHECK-DAG: 0000000000000003 0 NOTYPE GLOBAL DEFAULT ABS a2
a0 = DEFINED(.TOC.) ? .TOC. : 0;
"a1" = DEFINED(__global_pointer$) ? __global_pointer$ : 0;
"a2" = DEFINED("a1") ? "a1" + 3 : 0;