brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · e56f34c Raw
83 lines · plain
1# REQUIRES: aarch64, x862# RUN: split-file %s %t.dir && cd %t.dir3 4# Test that metadata is generated when a custom export thunk is supplied.5 6# RUN: llvm-mc -filetype=obj -triple=arm64ec-windows func.s -o func.obj7# RUN: llvm-mc -filetype=obj -triple=arm64ec-windows hp-func.s -o hp-func.obj8# RUN: llvm-mc -filetype=obj -triple=x86_64-windows thunk.s -o thunk.obj9# RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o loadconfig-arm64ec.obj10 11# RUN: lld-link -out:out.dll -machine:arm64ec func.obj thunk.obj loadconfig-arm64ec.obj -dll -noentry "-export:#func,EXPORTAS,func"12 13# RUN: llvm-objdump -d out.dll | FileCheck --check-prefixes=DISASM,DISASM-EXP %s14# DISASM:      Disassembly of section .text:15# DISASM-EMPTY:16# DISASM-NEXT: 0000000180001000 <.text>:17# DISASM-NEXT: 180001000: 52800040     mov     w0, #0x2                // =218# DISASM-NEXT: 180001004: d65f03c0     ret19# DISASM-NEXT:                 ...20# DISASM-EXP-EMPTY:21# DISASM-EXP-NEXT: 0000000180002000 <func>:22# DISASM-NEXT: 180002000: b8 03 00 00 00               movl    $0x3, %eax23# DISASM-NEXT: 180002005: c3                           retq24 25# RUN: llvm-objdump -p out.dll | FileCheck --check-prefix=EXPORT %s26# EXPORT:      Ordinal      RVA  Name27# EXPORT-NEXT:       1   0x2000  func28 29# RUN: llvm-readobj --coff-load-config out.dll | FileCheck --check-prefix=CHPE %s30# CHPE:       CodeMap [31# CHPE-NEXT:    0x1000 - 0x1008  ARM64EC32# CHPE-NEXT:    0x2000 - 0x2006  X6433# CHPE-NEXT:  ]34# CHPE-NEXT:  CodeRangesToEntryPoints [35# CHPE-NEXT:    0x2000 - 0x2006 -> 0x200036# CHPE-NEXT:  ]37# CHPE-NEXT:  RedirectionMetadata [38# CHPE-NEXT:    0x2000 -> 0x100039# CHPE-NEXT:  ]40 41# RUN: lld-link -out:out2.dll -machine:arm64ec hp-func.obj thunk.obj loadconfig-arm64ec.obj -dll -noentry42# RUN: llvm-objdump -d out2.dll | FileCheck --check-prefix=DISASM %s43# RUN: llvm-readobj --coff-load-config out2.dll | FileCheck --check-prefix=CHPE %s44 45#--- func.s46    .globl "#func"47    .p2align 2, 0x048"#func":49    mov w0, #250    ret51 52#--- hp-func.s53    .section .text,"xr",discard,"#func$hp_target"54    .globl "#func$hp_target"55    .p2align 2, 0x056"#func$hp_target":57    mov w0, #258    ret59 60    .def "EXP+#func"61    .scl 262    .type 3263    .endef64    .weak func65.set func, "EXP+#func"66    .weak "#func"67.set "#func", "#func$hp_target"68 69    .data70    .rva func71 72#--- thunk.s73    .def "EXP+#func"74    .scl 275    .type 3276    .endef77    .section .wowthk$aa,"xr",discard,"EXP+#func"78    .globl "EXP+#func"79    .p2align 2, 0x080"EXP+#func":81    movl $3, %eax82    retq83