# RUN: mkdir -p %t.dir # RUN: cp %p/Inputs/hello64.obj %t.dir # RUN: cp %p/Inputs/std64.lib %t.dir # RUN: not lld-link /out:%t.exe /entry:main /subsystem:console \ # RUN: hello64.obj /defaultlib:std64.lib >& %t.log # RUN: FileCheck -DMSG=%errc_ENOENT -check-prefix=CHECK1 %s < %t.log # RUN: not lld-link /out:%t.exe /entry:main /subsystem:console \ # RUN: hello64 /defaultlib:std64.lib >& %t.log # RUN: FileCheck -DMSG=%errc_ENOENT -check-prefix=CHECK2 %s < %t.log # RUN: lld-link /libpath:%t.dir /out:%t.exe /entry:main \ # RUN: /subsystem:console hello64.obj /defaultlib:std64.lib \ # RUN: /nodefaultlib:std64.lib >& %t.log || true # RUN: FileCheck -check-prefix=CHECK3 %s < %t.log # RUN: lld-link /libpath:%t.dir /out:%t.exe /entry:main \ # RUN: /subsystem:console hello64.obj /defaultlib:std64 \ # RUN: /nodefaultlib:std64.lib >& %t.log || true # RUN: FileCheck -check-prefix=CHECK3 %s < %t.log CHECK1: error: could not open 'hello64.obj': [[MSG]] CHECK2: error: could not open 'hello64': [[MSG]] CHECK3: error: undefined symbol: MessageBoxA CHECK3-NEXT: >>> referenced by {{.*}}hello64.obj:(main) # RUN: lld-link /libpath:%t.dir /out:%t.exe /entry:main \ # RUN: /subsystem:console hello64.obj /defaultlib:std64.lib # RUN: env LIB=%t.dir lld-link /out:%t.exe /entry:main \ # RUN: /subsystem:console hello64.obj /defaultlib:std64.lib MSVC stamps uppercase references in OBJ directives, thus ensure that passing lowercase 'libcmt' and 'oldnames' to /nodefaultlib works. # 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 # RUN: llvm-pdbutil dump -modules %t.pdb | FileCheck %s -check-prefix UPPERCASE UPPERCASE-NOT: OLDNAMES UPPERCASE-NOT: LIBCMT # RUN: yaml2obj -o %t.dir/defaultlib.obj %p/Inputs/defaultlib.yaml # RUN: mkdir -p %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64 # RUN: cp %p/Inputs/ret42.lib %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64/default.lib # RUN: lld-link /winsysroot:%t.dir/sysroot /out:%t.exe /entry:main /subsystem:console %t.dir/defaultlib.obj # RUN: not lld-link /winsysroot:%t.dir/sysroot /out:%t.exe /entry:main /subsystem:console /nodefaultlib:default.lib %t.dir/defaultlib.obj 2>&1 | FileCheck -check-prefix=CHECK4 %s CHECK4: error: : undefined symbol: main