2 RUN
: split-file
%s
%t.dir
&& cd
%t.dir
4 RUN
: llvm-mc
-filetype
=obj
-triple
=arm64ec-windows ext.s
-o ext.obj
5 RUN
: llvm-mc
-filetype
=obj
-triple
=arm64ec-windows impl.s
-o impl.obj
6 RUN
: llvm-mc
-filetype
=obj
-triple
=arm64ec-windows impl-cpp.s
-o impl-cpp.obj
7 RUN
: llvm-mc
-filetype
=obj
-triple
=arm64ec-windows
%S
/Inputs
/loadconfig-arm64ec.s
-o loadconfig.obj
9 # Ensure -alternatename can change a mangled function symbol aliasing a defined symbol (typically a guest exit thunk).
11 RUN
: lld-link
-machine
:arm64ec
-dll
-noentry
-out
:out1.dll ext.obj loadconfig.obj
"-alternatename:#func=altsym"
13 RUN
: llvm-objdump
-d out1.dll | FileCheck
--check-prefix
=DISASM
%s
14 DISASM
: 0000000180001000 <.text>:
15 DISASM-NEXT
: 180001000: 52800020 mov w0
, #0x1 // =1
16 DISASM-NEXT
: 180001004: d65f03c0 ret
19 RUN
: llvm-readobj
--hex-dump
=.test out1.dll | FileCheck --check-prefix=TESTSEC %s
20 TESTSEC
: 0x180005000 00100000 00100000
22 # Ensure -alternatename can change a demangled function symbol aliasing an anti-dependency symbol.
24 RUN
: lld-link
-machine
:arm64ec
-dll
-noentry
-out
:out2.dll ext.obj loadconfig.obj
-alternatename
:func
=altsym
26 RUN
: llvm-objdump
-d out2.dll | FileCheck
--check-prefix
=DISASM2
%s
27 DISASM2
: Disassembly of section
.text:
29 DISASM2-NEXT
: 0000000180001000 <.text>:
30 DISASM2-NEXT
: 180001000: 52800020 mov w0
, #0x1 // =1
31 DISASM2-NEXT
: 180001004: d65f03c0 ret
33 DISASM2-NEXT
: Disassembly of section
.thnk:
35 DISASM2-NEXT
: 0000000180006000 <.thnk>:
36 DISASM2-NEXT
: 180006000: 52800040 mov w0
, #0x2 // =2
37 DISASM2-NEXT
: 180006004: d65f03c0 ret
39 RUN
: llvm-readobj
--hex-dump
=.test out2.dll | FileCheck --check-prefix=TESTSEC2 %s
40 TESTSEC2
: 0x180005000 00100000 00600000
42 # Ensure -alternatename cannot modify a demangled function symbol aliasing a defined symbol.
44 RUN
: lld-link
-machine
:arm64ec
-dll
-noentry
-out
:out3.dll impl.obj loadconfig.obj
-alternatename
:func
=altsym
45 RUN
: llvm-objdump
-d out3.dll | FileCheck
--check-prefix
=DISASM
%s
46 RUN
: llvm-readobj
--hex-dump
=.test out3.dll | FileCheck --check-prefix=TESTSEC %s
48 RUN
: lld-link
-machine
:arm64ec
-dll
-noentry
-out
:out4.dll impl-cpp.obj loadconfig.obj
-alternatename
:func
=altsym
49 RUN
: llvm-objdump
-d out4.dll | FileCheck
--check-prefix
=DISASM
%s
50 RUN
: llvm-readobj
--hex-dump
=.test out4.dll | FileCheck --check-prefix=TESTSEC %s
55 .weak_anti_dep "#func"
56 .set "#func", thunksym
62 .section .thnk,"xr",discard,thunksym
67 .section .text,"xr",discard,altsym
81 .section .text,"xr",discard,"#func"
86 .section .text,"xr",discard,altsym
94 .set func, "?func@@$$hYAXXZ"
98 .rva "?func@@$$hYAXXZ"
100 .section .text,"xr",discard,"?func@@$$hYAXXZ"
105 .section .text,"xr",discard,altsym