Summary: This change does three things: - Try to find the file and line number of an undefined symbol reference by reading codeview debug info. - Try to find the name of the function or global variable with the undefined symbol reference by searching the object file's symbol table. - Prints the information in the same style as the ELF linker. Differential Revision: https://reviews.llvm.org/D45467 llvm-svn: 330235
32 lines
1.3 KiB
Plaintext
32 lines
1.3 KiB
Plaintext
# RUN: cp %p/Inputs/hello64.obj %T
|
|
# RUN: cp %p/Inputs/std64.lib %T
|
|
|
|
# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console \
|
|
# RUN: hello64.obj /defaultlib:std64.lib >& %t.log
|
|
# RUN: FileCheck -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 -check-prefix=CHECK2 %s < %t.log
|
|
|
|
# RUN: lld-link /libpath:%T /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 /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: {{[Nn]}}o such file or directory
|
|
CHECK2: error: could not open hello64: {{[Nn]}}o such file or directory
|
|
CHECK3: error: undefined symbol: MessageBoxA
|
|
CHECK3-NEXT: >>> referenced by {{.*}}hello64.obj:(main)
|
|
|
|
# RUN: lld-link /libpath:%T /out:%t.exe /entry:main \
|
|
# RUN: /subsystem:console hello64.obj /defaultlib:std64.lib
|
|
|
|
# RUN: env LIB=%T lld-link /out:%t.exe /entry:main \
|
|
# RUN: /subsystem:console hello64.obj /defaultlib:std64.lib
|