2015-10-01 07:15:35 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
2015-10-11 11:28:42 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
|
|
|
|
# RUN: %p/Inputs/libsearch-st.s -o %t2.o
|
2015-10-01 07:15:35 +08:00
|
|
|
|
2019-02-12 06:01:32 +08:00
|
|
|
# RUN: echo "EXTERN( undef undef2 \"undef3\" \"undef4@@other\")" > %t.script
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld %t -o %t2 %t.script
|
2015-10-20 01:35:12 +08:00
|
|
|
# RUN: llvm-readobj %t2 > /dev/null
|
|
|
|
|
2016-02-03 05:03:56 +08:00
|
|
|
# RUN: echo "OUTPUT_FORMAT(elf64-x86-64) /*/*/ GROUP(\"%t\" )" > %t.script
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld -o %t2 %t.script
|
2015-10-01 07:15:35 +08:00
|
|
|
# RUN: llvm-readobj %t2 > /dev/null
|
|
|
|
|
2015-10-07 08:25:09 +08:00
|
|
|
# RUN: rm -f %t.out
|
2016-02-03 05:03:56 +08:00
|
|
|
# RUN: echo "OUTPUT(\"%t.out\")" > %t.script
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld %t.script %t
|
2015-10-07 08:25:09 +08:00
|
|
|
# RUN: llvm-readobj %t.out > /dev/null
|
|
|
|
|
2015-10-09 01:51:41 +08:00
|
|
|
# RUN: echo "SEARCH_DIR(/lib/foo/blah)" > %t.script
|
2018-01-19 22:15:13 +08:00
|
|
|
# RUN: ld.lld %t.script %t -o %t.out
|
2015-10-09 01:51:41 +08:00
|
|
|
# RUN: llvm-readobj %t.out > /dev/null
|
|
|
|
|
2015-10-14 04:48:56 +08:00
|
|
|
# RUN: echo ";SEARCH_DIR(x);SEARCH_DIR(y);" > %t.script
|
2018-01-19 22:15:13 +08:00
|
|
|
# RUN: ld.lld %t.script %t -o %t.out
|
2015-10-14 04:48:56 +08:00
|
|
|
# RUN: llvm-readobj %t.out > /dev/null
|
|
|
|
|
|
|
|
# RUN: echo ";" > %t.script
|
2018-01-19 22:15:13 +08:00
|
|
|
# RUN: ld.lld %t.script %t -o %t.out
|
2015-10-14 04:48:56 +08:00
|
|
|
# RUN: llvm-readobj %t.out > /dev/null
|
|
|
|
|
2016-02-03 05:03:56 +08:00
|
|
|
# RUN: echo "INCLUDE \"%t.script2\" OUTPUT(\"%t.out\")" > %t.script1
|
|
|
|
# RUN: echo "GROUP(\"%t\")" > %t.script2
|
2018-01-19 22:15:13 +08:00
|
|
|
# RUN: ld.lld %t.script1 -o %t.out
|
2015-10-11 09:31:55 +08:00
|
|
|
# RUN: llvm-readobj %t2 > /dev/null
|
|
|
|
|
2019-10-30 01:17:22 +08:00
|
|
|
# RUN: rm -rf %t.dir && mkdir -p %t.dir
|
2016-12-21 17:42:25 +08:00
|
|
|
# RUN: echo "INCLUDE \"foo.script\"" > %t.script
|
2019-10-30 01:17:22 +08:00
|
|
|
# RUN: echo "OUTPUT(\"%t.out\")" > %t.dir/foo.script
|
2020-02-13 13:48:45 +08:00
|
|
|
# RUN: not ld.lld %t.script -o /dev/null > %t.log 2>&1
|
2016-12-21 17:42:25 +08:00
|
|
|
# RUN: FileCheck -check-prefix=INCLUDE_ERR %s < %t.log
|
2017-11-20 23:43:20 +08:00
|
|
|
# INCLUDE_ERR: error: {{.+}}.script:1: cannot find linker script foo.script
|
2017-08-23 16:48:39 +08:00
|
|
|
# INCLUDE_ERR-NEXT: INCLUDE "foo.script"
|
2019-10-30 01:17:22 +08:00
|
|
|
# RUN: ld.lld -L %t.dir %t.script %t
|
2016-12-21 17:42:25 +08:00
|
|
|
|
2015-10-01 07:15:35 +08:00
|
|
|
# RUN: echo "FOO(BAR)" > %t.script
|
2020-02-13 13:48:45 +08:00
|
|
|
# RUN: not ld.lld -o /dev/null %t.script > %t.log 2>&1
|
2015-10-01 07:15:35 +08:00
|
|
|
# RUN: FileCheck -check-prefix=ERR1 %s < %t.log
|
|
|
|
|
2016-03-11 22:43:02 +08:00
|
|
|
# ERR1: unknown directive: FOO
|
2015-10-01 07:15:35 +08:00
|
|
|
|
2016-04-27 10:58:27 +08:00
|
|
|
.globl _start, _label
|
2015-10-01 07:15:35 +08:00
|
|
|
_start:
|
2016-12-09 06:36:12 +08:00
|
|
|
ret
|
2015-10-08 14:48:38 +08:00
|
|
|
_label:
|
2016-12-09 06:36:12 +08:00
|
|
|
ret
|