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: rm -rf %t.dir && mkdir -p %t.dir 7# RUN: echo 'OUTPUT("%t.out")' > %t.dir/script 8# RUN: ld.lld -T%t.dir/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 -Tscript %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.dir -Tscript %t.o 19# RUN: llvm-readobj %t.out | FileCheck %s 20