summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/absolute2.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/linkerscript/absolute2.s')
-rw-r--r--test/ELF/linkerscript/absolute2.s17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/absolute2.s b/test/ELF/linkerscript/absolute2.s
new file mode 100644
index 0000000000000..513468d258147
--- /dev/null
+++ b/test/ELF/linkerscript/absolute2.s
@@ -0,0 +1,17 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
+
+# RUN: echo "SECTIONS { .text : { *(.text) } foo = ABSOLUTE(_start) + _start; };" > %t.script
+# RUN: ld.lld -o %t --script %t.script %t.o
+# RUN: llvm-objdump -t %t | FileCheck %s
+
+# RUN: echo "SECTIONS { .text : { *(.text) } foo = _start + ABSOLUTE(_start); };" > %t.script
+# RUN: ld.lld -o %t --script %t.script %t.o
+# RUN: llvm-objdump -t %t | FileCheck %s
+
+# CHECK: 0000000000000001 .text 00000000 _start
+# CHECK: 0000000000000002 .text 00000000 foo
+
+ .global _start
+ nop
+_start: