]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/linkerscript/linker-script-in-search-path.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / linkerscript / linker-script-in-search-path.s
1 # REQUIRES: x86
2 # Check that we fall back to search paths if a linker script was not found
3 # This behaviour matches ld.bfd and various projects appear to rely on this
4
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
6 # RUN: mkdir -p %T/searchpath
7 # RUN: echo 'OUTPUT("%t.out")' > %T/searchpath/%basename_t.script
8 # RUN: ld.lld -T%T/searchpath/%basename_t.script %t.o
9 # RUN: llvm-readobj %t.out | FileCheck %s
10 # CHECK: Format: ELF64-x86-64
11
12 # If the linker script specified with -T is missing we should emit an error
13 # RUN: not ld.lld -T%basename_t.script %t.o 2>&1 | FileCheck %s -check-prefix ERROR
14 # ERROR: error: cannot find linker script {{.*}}.script
15
16 # But if it exists in the search path we should fall back to that instead:
17 # RUN: rm %t.out
18 # RUN: ld.lld -L %T/searchpath -T%basename_t.script %t.o
19 # RUN: llvm-readobj %t.out | FileCheck %s