[lld] [LLD][COFF] Handle imported weak aliases consistently (PR #109105)

Mike Hommey via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 04:37:19 PDT 2024


================
@@ -0,0 +1,25 @@
+# REQUIRES: x86
+
+# RUN: split-file %s %t.dir
+# RUN: llc --filetype=obj -o %t.foo.obj %t.dir/foo.ll
+# RUN: llvm-mc --filetype=obj -triple=x86_64-windows-msvc %t.dir/qux.s -o %t.qux.obj
+# RUN: lld-link %t.qux.obj %t.foo.obj -out:%t.dll -dll 2>&1 | FileCheck %s
+#
+# CHECK-NOT: lld-link: error: undefined symbol: __declspec(dllimport) foo
+
+#--- foo.ll
+target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-windows-msvc"
+
+ at foo = weak alias void(), ptr @bar
----------------
glandium wrote:

I reduced a version from the output of llc --filetype=asm.

https://github.com/llvm/llvm-project/pull/109105


More information about the llvm-commits mailing list