summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/target.s
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:05:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:05:49 +0000
commite2fd426bdafe9f5c10066d3926ece6e342184a67 (patch)
treebfbbb5fd38554e6b8988b7a217e9fd0623728d7d /test/ELF/linkerscript/target.s
parent84c4061b34e048f47e5eb4fbabc1558495e8157c (diff)
Notes
Diffstat (limited to 'test/ELF/linkerscript/target.s')
-rw-r--r--test/ELF/linkerscript/target.s18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/target.s b/test/ELF/linkerscript/target.s
new file mode 100644
index 0000000000000..32db5b7866c2a
--- /dev/null
+++ b/test/ELF/linkerscript/target.s
@@ -0,0 +1,18 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
+# RUN: echo "TARGET(binary) INPUT(\"%t.o\") TARGET(elf64-x86-64) INPUT(\"%t.o\")" > %t.script
+# RUN: ld.lld --script %t.script -o %t.exe
+# RUN: llvm-readelf -symbols %t.exe | FileCheck %s
+
+# CHECK: _binary_
+# CHECK: foobar
+
+# RUN: echo "TARGET(foo)" > %t2.script
+# RUN: not ld.lld --script %t2.script -o /dev/null 2>&1 | FileCheck -check-prefix=ERR %s
+
+# ERR: unknown target: foo
+
+.global foobar
+foobar:
+ nop