[lld] [LLD][COFF] Use archive's ECSYMBOLS on ARM64EC target when available. (PR #106904)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 05:03:06 PDT 2024


================
@@ -0,0 +1,41 @@
+REQUIRES: aarch64, x86
+RUN: split-file %s %t.dir && cd %t.dir
+
+RUN: llvm-mc -filetype=obj -triple=arm64ec-windows symref.s -o symref-arm64ec.obj
+RUN: llvm-mc -filetype=obj -triple=arm64ec-windows nsymref.s -o nsymref-arm64ec.obj
+RUN: llvm-mc -filetype=obj -triple=aarch64-windows nsymref.s -o nsymref-aarch64.obj
+RUN: llvm-mc -filetype=obj -triple=arm64ec-windows sym.s -o sym-arm64ec.obj
+RUN: llvm-mc -filetype=obj -triple=x86_64-windows sym.s -o sym-x86_64.obj
+RUN: llvm-mc -filetype=obj -triple=aarch64-windows nsym.s -o sym-aarch64.obj
+RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o loadconfig-arm64ec.obj
+
+RUN: llvm-lib -machine:arm64ec -out:sym-arm64ec.lib sym-arm64ec.obj sym-aarch64.obj
+RUN: llvm-lib -machine:amd64 -out:sym-x86_64.lib sym-x86_64.obj
+
+RUN: lld-link -machine:arm64ec -dll -noentry -out:test.dll symref-arm64ec.obj sym-arm64ec.lib loadconfig-arm64ec.obj
+RUN: lld-link -machine:arm64ec -dll -noentry -out:test2.dll symref-arm64ec.obj sym-x86_64.lib loadconfig-arm64ec.obj
+RUN: lld-link -machine:arm64x -dll -noentry -out:test3.dll symref-arm64ec.obj nsymref-aarch64.obj sym-arm64ec.lib loadconfig-arm64ec.obj
+
+RUN: not lld-link -machine:arm64ec -dll -noentry -out:test-err.dll nsymref-arm64ec.obj sym-arm64ec.lib loadconfig-arm64ec.obj 2>&1 |\
+RUN:              FileCheck --check-prefix=ERR %s
----------------
mstorsjo wrote:

I'm not quite sure exactly which kind of failure that this test tries to showcase - isn't this the most trivial failure? We've got a library that contains two definitions of `sym` for different architectures, and we have an undefined reference to `nsym`?

Other than that, it'd be nice with a bit more comments about which scenarios the cases above actually tests (what the expected behaviour is, and what the various nuances are). Not sure if it needs to be as comments in the test file, but at least a brief narration of the testcase (as an inline comment or so) would be nice.

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


More information about the llvm-commits mailing list