1# RUN: mkdir -p %t/a %t/b %t/c
2# RUN: cp %p/Inputs/std64.lib %t/a/
3# RUN: cp %p/Inputs/std64.lib %t/b/
4# RUN: cp %p/Inputs/std64.lib %t/c/
5
6# RUN: env LIB=%t/a lld-link /out:%t.exe /entry:main /verbose \
7# RUN:   std64.lib /subsystem:console %p/Inputs/hello64.obj \
8# RUN:   /libpath:%t/b /libpath:%t/c 2> %t.log
9# RUN: FileCheck -check-prefix=CHECK1 %s < %t.log
10
11CHECK1: b{{[/\\]}}std64.lib
12
13# RUN: lld-link /out:%t.exe /entry:main /verbose \
14# RUN:   std64.lib /subsystem:console %p/Inputs/hello64.obj \
15# RUN:   /libpath:%t/a /libpath:%t/b /libpath:%t/c 2> %t.log
16# RUN: FileCheck -check-prefix=CHECK2 %s < %t.log
17
18CHECK2: a{{[/\\]}}std64.lib
19
20# RUN: lld-link /out:%t.exe /entry:main /verbose \
21# RUN:   %t/a/std64.lib /subsystem:console %p/Inputs/hello64.obj \
22# RUN:   /libpath:%t/b /verbose > %t.log 2>&1
23# RUN: FileCheck -check-prefix=CHECK3 %s < %t.log
24
25CHECK3:     Reading {{.*}}a/std64.lib
26CHECK3-NOT: Reading {{.*}}b/std64.lib
27
28# RUN: env LIB=%t/a lld-link /out:%t.exe /entry:main /verbose \
29# RUN:   std64.lib /subsystem:console %p/Inputs/hello64.obj \
30# RUN:   2> %t.log
31# RUN: FileCheck -check-prefix=CHECK4 %s < %t.log
32
33CHECK4: a{{[/\\]}}std64.lib
34
35# This should fail because /lldignoreenv should make lld-link
36# ignore the LIB env var.
37# RUN: env LIB=%t/a not lld-link /out:%t.exe /entry:main /verbose \
38# RUN:   std64.lib /subsystem:console %p/Inputs/hello64.obj \
39# RUN:   /lldignoreenv
40