|
| 1 | +# REQUIRES: aarch64 |
| 2 | + |
| 3 | +# RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %s -o %t.obj |
| 4 | +# RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o %t-loadconfig.obj |
| 5 | + |
| 6 | +# RUN: lld-link -machine:arm64ec -dll -noentry -out:%t1.dll %t.obj %t-loadconfig.obj "-alternatename:#func=altsym" |
| 7 | + |
| 8 | +# RUN: llvm-objdump -d %t1.dll | FileCheck --check-prefix=DISASM %s |
| 9 | +# DISASM: 0000000180001000 <.text>: |
| 10 | +# DISASM-NEXT: 180001000: 52800020 mov w0, #0x1 // =1 |
| 11 | +# DISASM-NEXT: 180001004: d65f03c0 ret |
| 12 | +# DISASM-NOT: .thnk |
| 13 | + |
| 14 | +# RUN: llvm-readobj --hex-dump=.test %t1.dll | FileCheck --check-prefix=TESTSEC %s |
| 15 | +# TESTSEC: 0x180004000 00100000 00100000 |
| 16 | + |
| 17 | +# RUN: lld-link -machine:arm64ec -dll -noentry -out:%t2.dll %t.obj %t-loadconfig.obj -alternatename:func=altsym |
| 18 | + |
| 19 | +# RUN: llvm-objdump -d %t2.dll | FileCheck --check-prefix=DISASM2 %s |
| 20 | +# DISASM2: Disassembly of section .text: |
| 21 | +# DISASM2-EMPTY: |
| 22 | +# DISASM2-NEXT: 0000000180001000 <.text>: |
| 23 | +# DISASM2-NEXT: 180001000: 52800020 mov w0, #0x1 // =1 |
| 24 | +# DISASM2-NEXT: 180001004: d65f03c0 ret |
| 25 | +# DISASM2-EMPTY: |
| 26 | +# DISASM2-NEXT: Disassembly of section .thnk: |
| 27 | +# DISASM2-EMPTY: |
| 28 | +# DISASM2-NEXT: 0000000180005000 <.thnk>: |
| 29 | +# DISASM2-NEXT: 180005000: 52800040 mov w0, #0x2 // =2 |
| 30 | +# DISASM2-NEXT: 180005004: d65f03c0 ret |
| 31 | + |
| 32 | +# RUN: llvm-readobj --hex-dump=.test %t2.dll | FileCheck --check-prefix=TESTSEC2 %s |
| 33 | +# TESTSEC2: 0x180004000 00100000 00500000 |
| 34 | + |
| 35 | + .weak_anti_dep func |
| 36 | +.set func, "#func" |
| 37 | + .weak_anti_dep "#func" |
| 38 | +.set "#func", thunksym |
| 39 | + |
| 40 | + .section .test, "r" |
| 41 | + .rva func |
| 42 | + .rva "#func" |
| 43 | + |
| 44 | + .section .thnk,"xr",discard,thunksym |
| 45 | +thunksym: |
| 46 | + mov w0, #2 |
| 47 | + ret |
| 48 | + |
| 49 | + .section .text,"xr",discard,altsym |
| 50 | + .globl altsym |
| 51 | +altsym: |
| 52 | + mov w0, #1 |
| 53 | + ret |
0 commit comments