|
| 1 | +REQUIRES: aarch64 |
| 2 | +RUN: split-file %s %t.dir && cd %t.dir |
| 3 | + |
| 4 | +RUN: llvm-mc -filetype=obj -triple=arm64ec-windows funcs.s -o funcs.obj |
| 5 | +RUN: llvm-mc -filetype=obj -triple=arm64ec-windows func-mangled.s -o func-mangled.obj |
| 6 | +RUN: llvm-mc -filetype=obj -triple=arm64ec-windows impsym.s -o impsym.obj |
| 7 | +RUN: llvm-mc -filetype=obj -triple=arm64ec-windows impauxsym.s -o impauxsym.obj |
| 8 | + |
| 9 | +Ensure that when both mangled and demangled symbols are present, the __imp_ symbol |
| 10 | +resolves to the demangled symbol. |
| 11 | + |
| 12 | +RUN: lld-link -machine:arm64ec -dll -noentry funcs.obj impsym.obj -out:impsym.dll |
| 13 | + |
| 14 | +RUN: llvm-readobj --coff-basereloc impsym.dll | FileCheck --check-prefix=RELOCS %s |
| 15 | +RELOCS: Entry { |
| 16 | +RELOCS-NEXT: Type: DIR64 |
| 17 | +RELOCS-NEXT: Address: 0x2000 |
| 18 | +RELOCS-NEXT: } |
| 19 | + |
| 20 | +RUN: llvm-readobj --hex-dump=.test impsym.dll | FileCheck --check-prefix=TEST %s |
| 21 | +TEST: 0x180003000 00200000 |
| 22 | + |
| 23 | +RUN: llvm-readobj --hex-dump=.rdata impsym.dll | FileCheck --check-prefix=RDATA-DEMANGLED %s |
| 24 | +RDATA-MANGLED: 0x180002000 00100080 01000000 |
| 25 | +RDATA-DEMANGLED: 0x180002000 04100080 01000000 |
| 26 | + |
| 27 | + |
| 28 | +Ensure that when both mangled and demangled symbols are present, the __imp_aux_ symbol |
| 29 | +resolves to the demangled symbol. |
| 30 | + |
| 31 | +RUN: lld-link -machine:arm64ec -dll -noentry funcs.obj impauxsym.obj -out:impauxsym.dll |
| 32 | +RUN: llvm-readobj --hex-dump=.test impauxsym.dll | FileCheck --check-prefix=TEST %s |
| 33 | +RUN: llvm-readobj --hex-dump=.rdata impauxsym.dll | FileCheck --check-prefix=RDATA-DEMANGLED %s |
| 34 | + |
| 35 | +Ensure that if only the mangled symbol is present, the __imp_ symbol resolves to it. |
| 36 | + |
| 37 | +RUN: lld-link -machine:arm64ec -dll -noentry func-mangled.obj impsym.obj -out:impsym-mangled.dll |
| 38 | +RUN: llvm-readobj --coff-basereloc impsym-mangled.dll | FileCheck --check-prefix=RELOCS %s |
| 39 | +RUN: llvm-readobj --hex-dump=.test impsym-mangled.dll | FileCheck --check-prefix=TEST %s |
| 40 | +RUN: llvm-readobj --hex-dump=.rdata impsym-mangled.dll | FileCheck --check-prefix=RDATA-MANGLED %s |
| 41 | + |
| 42 | +Ensure that if only the mangled symbol is present, the __imp_aux_ symbol resolves to it. |
| 43 | + |
| 44 | +RUN: lld-link -machine:arm64ec -dll -noentry func-mangled.obj impauxsym.obj -out:impauxsym-mangled.dll |
| 45 | +RUN: llvm-readobj --hex-dump=.test impauxsym-mangled.dll | FileCheck --check-prefix=TEST %s |
| 46 | +RUN: llvm-readobj --hex-dump=.rdata impauxsym-mangled.dll | FileCheck --check-prefix=RDATA-MANGLED %s |
| 47 | + |
| 48 | +#--- funcs.s |
| 49 | + .globl "#myfunc" |
| 50 | +"#myfunc": |
| 51 | + ret |
| 52 | + .text |
| 53 | + .globl myfunc |
| 54 | +myfunc: |
| 55 | + ret |
| 56 | + |
| 57 | +#--- func-mangled.s |
| 58 | + .globl "#myfunc" |
| 59 | +"#myfunc": |
| 60 | + ret |
| 61 | + |
| 62 | +#--- impsym.s |
| 63 | + .section .test, "r" |
| 64 | + .rva __imp_myfunc |
| 65 | + |
| 66 | +#--- impauxsym.s |
| 67 | + .section .test, "r" |
| 68 | + .rva __imp_aux_myfunc |
0 commit comments