mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 22:06:38 +00:00

This reverts commit 6a1bdd9 and re-instate behavior that matches what MSVC link.exe does, that is, error out when trying to dllimport a symbol from a static library. A hint is now displayed in stdout, mentioning that we should rather dllimport the symbol from a import library. Fixes https://github.com/llvm/llvm-project/issues/131807
27 lines
685 B
Plaintext
27 lines
685 B
Plaintext
# REQUIRES: x86
|
|
|
|
# Pulling in on both a dllimport symbol and a static symbol should only warn.
|
|
# RUN: split-file %s %t.dir
|
|
# RUN: llvm-mc --filetype=obj -triple=x86_64-windows-msvc %t.dir/other.s -o %t.other.obj
|
|
# RUN: llvm-mc --filetype=obj -triple=x86_64-windows-msvc %t.dir/main.s -o %t.main.obj
|
|
# RUN: llvm-lib %t.other.obj -out:%t.other.lib
|
|
# RUN: lld-link %t.other.lib %t.main.obj -out:%t.dll -dll 2>&1 | FileCheck %s
|
|
|
|
CHECK: warning: {{.*}} locally defined symbol imported: foo {{.*}} [LNK4217]
|
|
|
|
#--- other.s
|
|
.text
|
|
.globl other
|
|
.globl foo
|
|
other:
|
|
ret
|
|
foo:
|
|
ret
|
|
#--- main.s
|
|
.text
|
|
.global _DllMainCRTStartup
|
|
_DllMainCRTStartup:
|
|
call *other(%rip)
|
|
call *__imp_foo(%rip)
|
|
ret
|