brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.0 KiB · 1f02907 Raw
139 lines · plain
1REQUIRES: aarch64, x862RUN: split-file %s %t.dir && cd %t.dir3 4RUN: llvm-mc -filetype=obj -triple=arm64ec-windows demangled-dll-main.s -o demangled-dll-main.obj5RUN: llvm-mc -filetype=obj -triple=arm64ec-windows mangled-dll-main.s -o mangled-dll-main.obj6RUN: llvm-mc -filetype=obj -triple=arm64ec-windows demangled-func.s -o demangled-func.obj7RUN: llvm-mc -filetype=obj -triple=arm64ec-windows mangled-func.s -o mangled-func.obj8RUN: llvm-mc -filetype=obj -triple=arm64ec-windows ref-demangled.s -o ref-demangled.obj9RUN: llvm-mc -filetype=obj -triple=arm64ec-windows demangled-entry-drectve.s -o demangled-entry-drectve.obj10RUN: llvm-mc -filetype=obj -triple=x86_64-windows demangled-dll-main.s -o x64-dll-main.obj11RUN: llvm-mc -filetype=obj -triple=x86_64-windows ref-demangled.s -o ref-x64.obj12RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o loadconfig-arm64ec.obj13 14RUN: llvm-lib -machine:arm64ec -out:func.lib mangled-func.obj15RUN: llvm-lib -machine:arm64ec -out:dllmain.lib mangled-dll-main.obj16 17Ensure that the linker recognizes the demangled version of _DllMainCRTStartup.18RUN: lld-link -machine:arm64ec -dll -out:demangled-main.dll demangled-dll-main.obj loadconfig-arm64ec.obj19RUN: llvm-objdump -d demangled-main.dll | FileCheck -check-prefix=DISASM %s20 21DISASM:      0000000180001000 <.text>:22DISASM-NEXT: 180001000: d65f03c0     ret23DISASM-EMPTY:24DISASM-NEXT: Disassembly of section .hexpthk:25DISASM-EMPTY:26DISASM:      180002000: 48 8b c4                     movq    %rsp, %rax27DISASM-NEXT: 180002003: 48 89 58 20                  movq    %rbx, 0x20(%rax)28DISASM-NEXT: 180002007: 55                           pushq   %rbp29DISASM-NEXT: 180002008: 5d                           popq    %rbp30DISASM-NEXT: 180002009: e9 f2 ef ff ff               jmp     0x180001000 <.text>31DISASM-NEXT: 18000200e: cc                           int332DISASM-NEXT: 18000200f: cc                           int333 34Ensure that the linker recognizes the mangled version of #_DllMainCRTStartup.35RUN: lld-link -machine:arm64ec -dll -out:mangled-dllmain.dll mangled-dll-main.obj loadconfig-arm64ec.obj36RUN: llvm-objdump -d mangled-dllmain.dll | FileCheck -check-prefix=DISASM %s37 38Verify that the linker recognizes the mangled version of _DllMainCRTStartup from an archive.39RUN: lld-link -machine:arm64ec -dll -out:mangled-lib-dllmain.dll dllmain.lib loadconfig-arm64ec.obj40RUN: llvm-objdump -d mangled-lib-dllmain.dll | FileCheck -check-prefix=DISASM %s41 42Verify that the linker recognizes the demangled entry function.43RUN: lld-link -machine:arm64ec -dll -out:demangled-entry.dll demangled-func.obj loadconfig-arm64ec.obj -entry:func44RUN: llvm-objdump -d demangled-entry.dll | FileCheck -check-prefix=DISASM %s45 46Verify that the linker recognizes the mangled entry function when it is referenced by its demangled name.47RUN: lld-link -machine:arm64ec -dll -out:mangled-entry.dll mangled-func.obj loadconfig-arm64ec.obj -entry:func48RUN: llvm-objdump -d mangled-entry.dll | FileCheck -check-prefix=DISASM %s49 50Verify that the linker recognizes the mangled entry function when it is referenced by its demangled51name in drectve section.52RUN: lld-link -machine:arm64ec -dll -out:mangled-entry.dll mangled-func.obj loadconfig-arm64ec.obj demangled-entry-drectve.obj53RUN: llvm-objdump -d mangled-entry.dll | FileCheck -check-prefix=DISASM %s54 55Verify that the linker recognizes the mangled entry function from an archive.56RUN: lld-link -machine:arm64ec -dll -out:mangled-lib-entry.dll func.lib loadconfig-arm64ec.obj -entry:func57RUN: llvm-objdump -d mangled-lib-entry.dll | FileCheck -check-prefix=DISASM %s58 59Verify that the linker recognizes the entry function when referenced by its mangled name.60RUN: lld-link -machine:arm64ec -dll -out:mangled-entry2.dll mangled-func.obj loadconfig-arm64ec.obj "-entry:#func"61RUN: llvm-objdump -d mangled-entry2.dll | FileCheck -check-prefix=DISASM %s62 63Verify that the linker recognizes the demangled exported function.64RUN: lld-link -machine:arm64ec -dll -out:demangled-export.dll demangled-func.obj \65RUN:          loadconfig-arm64ec.obj -noentry -export:func66RUN: llvm-objdump -d demangled-export.dll | FileCheck -check-prefix=DISASM %s67 68Verify that the linker recognizes the mangled exported function when referenced by its demangled name.69RUN: lld-link -machine:arm64ec -dll -out:mangled-export.dll mangled-func.obj \70RUN:          loadconfig-arm64ec.obj -noentry -export:func71RUN: llvm-objdump -d mangled-export.dll | FileCheck -check-prefix=DISASM %s72 73Verify that the linker recognizes the mangled exported function when referenced by its mangled name.74RUN: lld-link -machine:arm64ec -dll -out:mangled-export2.dll mangled-func.obj \75RUN:          loadconfig-arm64ec.obj -noentry "-export:#func"76RUN: llvm-objdump -d mangled-export2.dll | FileCheck -check-prefix=DISASM %s77 78Verify that the linker recognizes the mangled exported function when referenced79by its mangled name and creates a demangled alias for it.80RUN: lld-link -machine:arm64ec -dll -noentry -out:demangled-export-ref.dll mangled-func.obj \81RUN:          ref-demangled.obj loadconfig-arm64ec.obj "-export:#func"82RUN: llvm-objdump -d demangled-export-ref.dll | FileCheck -check-prefix=DISASM %s83 84Verify that an x86_64 object file can reference ARM64EC mangled functions without requiring an explicit alias.85RUN: lld-link -machine:arm64ec -dll -noentry -out:x64-ref.dll mangled-func.obj ref-x64.obj loadconfig-arm64ec.obj86RUN: llvm-objdump -d x64-ref.dll | FileCheck -check-prefix=DISASM2 %s87 88Verify that an x86_64 object file can reference ARM64EC mangled functions provided by a library.89RUN: lld-link -machine:arm64ec -dll -noentry -out:x64-lib-ref.dll func.lib ref-x64.obj loadconfig-arm64ec.obj90RUN: llvm-objdump -d x64-lib-ref.dll | FileCheck -check-prefix=DISASM2 %s91 92DISASM2:      0000000180001000 <.text>:93DISASM2-NEXT: 180001000: d65f03c0     ret94 95Verify that the linker emits appropriate errors for mismatched mangling.96RUN: not lld-link -machine:arm64ec -dll -out:test.dll demangled-func.obj loadconfig-arm64ec.obj \97RUN:              "-entry:#func" 2>&1 | FileCheck -check-prefix=FUNC-NOT-FOUND %s98RUN: not lld-link -machine:arm64ec -dll -out:test.dll demangled-func.obj loadconfig-arm64ec.obj \99RUN:              -noentry "-export:#func" 2>&1 | FileCheck -check-prefix=FUNC-NOT-FOUND %s100FUNC-NOT-FOUND: undefined symbol: #func (EC symbol)101 102Verify that the linker recognizes the demangled x86_64 _DllMainCRTStartup.103RUN: lld-link -machine:arm64ec -dll -out:test.dll x64-dll-main.obj loadconfig-arm64ec.obj104RUN: llvm-objdump -d test.dll | FileCheck -check-prefix=DISASM-X64 %s105DISASM-X64:      0000000180001000 <.text>:106DISASM-X64-NEXT: 180001000: c3                           retq107 108#--- demangled-dll-main.s109    .text110    .globl _DllMainCRTStartup111_DllMainCRTStartup:112    ret113 114#--- mangled-dll-main.s115    .text116    .globl "#_DllMainCRTStartup"117"#_DllMainCRTStartup":118    ret119 120#--- demangled-func.s121    .text122    .globl func123func:124    ret125 126#--- mangled-func.s127    .text128    .globl "#func"129"#func":130    ret131 132#--- ref-demangled.s133    .data134    .rva func135 136#--- demangled-entry-drectve.s137	.section .drectve,"rd"138	.ascii " -entry:func"139