llvm-project/lld/test/COFF/arm64ec-invalid-name.s
Jacek Caban cdda76a8cf
[LLD][COFF] Fix handling of invalid ARM64EC function names (#116252)
Since these symbols cannot be mangled or demangled, there is no symbol
to check for conflicts in `checkLazyECPair`, nor is there an alias to
create in `addUndefined`. Attempting to create an import library with
such symbols results in an error; the patch includes a test to ensure
the error is handled correctly.

This is a follow-up to #115567.
2024-11-15 16:42:36 +01:00

16 lines
696 B
ArmAsm

// REQUIRES: aarch64
// Verify that an error is emitted when attempting to export an invalid function name.
// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %s -o %t.obj
// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o %t-loadconfig.obj
// RUN: not lld-link -machine:arm64ec -dll -noentry "-export:?func" %t-loadconfig.obj %t.obj 2>&1 | FileCheck %s
// CHECK: error: Invalid ARM64EC function name '?func'
// Verify that we can handle an invalid function name in the archive map.
// RUN: llvm-lib -machine:arm64ec -out:%t.lib %t.obj
// RUN: lld-link -machine:arm64ec -dll -noentry %t-loadconfig.obj %t.lib
.globl "?func"
"?func":
ret