diff options
Diffstat (limited to 'test/ELF/linkerscript/early-assign-symbol.s')
-rw-r--r-- | test/ELF/linkerscript/early-assign-symbol.s | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/early-assign-symbol.s b/test/ELF/linkerscript/early-assign-symbol.s new file mode 100644 index 0000000000000..21940c088393d --- /dev/null +++ b/test/ELF/linkerscript/early-assign-symbol.s @@ -0,0 +1,14 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o + +# RUN: echo "SECTIONS { aaa = 1 + ABSOLUTE(foo - 1); .text : { *(.text*) } }" > %t1.script +# RUN: not ld.lld -o %t --script %t1.script %t.o 2>&1 | FileCheck %s + +# RUN: echo "SECTIONS { aaa = ABSOLUTE(foo - 1) + 1; .text : { *(.text*) } }" > %t2.script +# RUN: not ld.lld -o %t --script %t2.script %t.o 2>&1 | FileCheck %s + +# CHECK: error: unable to evaluate expression: input section .text has no output section assigned + +.section .text +.globl foo +foo: |