1# RUN: cp %p/Inputs/hello64.obj %T
2# RUN: cp %p/Inputs/std64.lib %T
3
4# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console \
5# RUN:   hello64.obj /defaultlib:std64.lib >& %t.log
6# RUN: FileCheck -check-prefix=CHECK1 %s < %t.log
7
8# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console \
9# RUN:   hello64 /defaultlib:std64.lib >& %t.log
10# RUN: FileCheck -check-prefix=CHECK2 %s < %t.log
11
12# RUN: lld-link /libpath:%T /out:%t.exe /entry:main \
13# RUN:   /subsystem:console hello64.obj /defaultlib:std64.lib \
14# RUN:   /nodefaultlib:std64.lib >& %t.log || true
15# RUN: FileCheck -check-prefix=CHECK3 %s < %t.log
16
17# RUN: lld-link /libpath:%T /out:%t.exe /entry:main \
18# RUN:   /subsystem:console hello64.obj /defaultlib:std64 \
19# RUN:   /nodefaultlib:std64.lib >& %t.log || true
20# RUN: FileCheck -check-prefix=CHECK3 %s < %t.log
21
22CHECK1: error: could not open 'hello64.obj': {{[Nn]}}o such file or directory
23CHECK2: error: could not open 'hello64': {{[Nn]}}o such file or directory
24CHECK3: error: undefined symbol: MessageBoxA
25CHECK3-NEXT: >>> referenced by {{.*}}hello64.obj:(main)
26
27# RUN: lld-link /libpath:%T /out:%t.exe /entry:main \
28# RUN:   /subsystem:console hello64.obj /defaultlib:std64.lib
29
30# RUN: env LIB=%T lld-link /out:%t.exe /entry:main \
31# RUN:   /subsystem:console hello64.obj /defaultlib:std64.lib
32
33MSVC stamps uppercase references in OBJ directives, thus ensure that passing lowercase 'libcmt' and 'oldnames' to /nodefaultlib works.
34# RUN: lld-link %S/Inputs/precomp.obj %S/Inputs/precomp-a.obj %S/Inputs/precomp-b.obj /nodefaultlib:libcmt /nodefaultlib:oldnames /entry:main /debug /pdb:%t.pdb /out:%t.exe /opt:ref /opt:icf
35# RUN: llvm-pdbutil dump -modules %t.pdb | FileCheck %s -check-prefix UPPERCASE
36
37UPPERCASE-NOT: OLDNAMES
38UPPERCASE-NOT: LIBCMT
39