1#!/bin/sh
2# REQUIRES: x86
3# UNSUPPORTED: system-windows
4
5# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux /dev/null -o %t0.o
6# RUN: not ld.lld -o /dev/null -lidontexist --error-handling-script=%s %t0.o 2>&1 |\
7# RUN:   FileCheck --check-prefix=CHECK-LIB %s
8# RUN: not ld.lld -o /dev/null -lidontexist --error-handling-script=%s.nope %t0.o 2>&1 |\
9# RUN:   FileCheck --check-prefix=CHECK-SCRIPT-DOES-NOT-EXIST -DFILE=%s.nope %s
10
11# CHECK-LIB:      script: info: called with missing-lib idontexist
12# CHECK-LIB-NEXT: ld.lld: error: unable to find library -lidontexist
13
14# CHECK-SCRIPT-DOES-NOT-EXIST:      ld.lld: error: unable to find library -lidontexist
15# CHECK-SCRIPT-DOES-NOT-EXIST-NEXT: ld.lld: error: error handling script '[[FILE]]' failed to execute
16
17echo "script: info: called with $*"
18