brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 870540d Raw
122 lines · plain
1; REQUIRES: aarch642; RUN: split-file %s %t.dir && cd %t.dir3 4; RUN: llvm-mc -filetype=obj -triple=arm64ec-windows test.s -o test.obj5; RUN: llvm-mc -filetype=obj -triple=arm64ec-windows drectve.s -o drectve.obj6; RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o loadconfig-arm64ec.obj7 8; Check various forms of export directive and make sure that function export name is demangled.9 10; RUN: lld-link -out:out.dll test.obj loadconfig-arm64ec.obj -dll -noentry -machine:arm64ec \11; RUN:          -export:unmangled_func '-export:#mangled_func' '-export:#exportas_func,EXPORTAS,exportas_func' \12; RUN:          '-export:?cxx_func@@$$hYAHXZ' -export:data_sym,DATA '-export:#mangled_data_sym,DATA'13 14 15; RUN: llvm-readobj --coff-exports out.dll | FileCheck --check-prefix=EXP %s16; EXP:      Export {17; EXP-NEXT:   Ordinal: 118; EXP-NEXT:   Name: #mangled_data_sym19; EXP-NEXT:   RVA: 0x400020; EXP-NEXT: }21; EXP-NEXT: Export {22; EXP-NEXT:   Ordinal: 223; EXP-NEXT:   Name: ?cxx_func@@YAHXZ24; EXP-NEXT:   RVA: 0x203025; EXP-NEXT: }26; EXP-NEXT: Export {27; EXP-NEXT:   Ordinal: 328; EXP-NEXT:   Name: data_sym29; EXP-NEXT:   RVA: 0x400430; EXP-NEXT: }31; EXP-NEXT: Export {32; EXP-NEXT:   Ordinal: 433; EXP-NEXT:   Name: exportas_func34; EXP-NEXT:   RVA: 0x202035; EXP-NEXT: }36; EXP-NEXT: Export {37; EXP-NEXT:   Ordinal: 538; EXP-NEXT:   Name: mangled_func39; EXP-NEXT:   RVA: 0x201040; EXP-NEXT: }41; EXP-NEXT: Export {42; EXP-NEXT:   Ordinal: 643; EXP-NEXT:   Name: unmangled_func44; EXP-NEXT:   RVA: 0x200045; EXP-NEXT: }46 47; RUN: llvm-nm --print-armap out.lib | FileCheck --check-prefix=IMPLIB %s48; IMPLIB:      Archive EC map49; IMPLIB-NEXT: #exportas_func in out50; IMPLIB-NEXT: #mangled_func in out51; IMPLIB-NEXT: #unmangled_func in out52; IMPLIB-NEXT: ?cxx_func@@$$hYAHXZ in out53; IMPLIB-NEXT: ?cxx_func@@YAHXZ in out54; IMPLIB-NEXT: __IMPORT_DESCRIPTOR_out{{.*}} in out55; IMPLIB-NEXT: __NULL_IMPORT_DESCRIPTOR in out56; IMPLIB-NEXT: __imp_?cxx_func@@YAHXZ in out57; IMPLIB-NEXT: __imp_aux_?cxx_func@@YAHXZ in out58; IMPLIB-NEXT: __imp_aux_exportas_func in out59; IMPLIB-NEXT: __imp_aux_mangled_func in out60; IMPLIB-NEXT: __imp_aux_unmangled_func in out61; IMPLIB-NEXT: __imp_data_sym in out62; IMPLIB-NEXT: __imp_exportas_func in out63; IMPLIB-NEXT: __imp_mangled_data_sym in out64; IMPLIB-NEXT: __imp_mangled_func in out65; IMPLIB-NEXT: __imp_unmangled_func in out66; IMPLIB-NEXT: exportas_func in out67; IMPLIB-NEXT: mangled_func in out68; IMPLIB-NEXT: unmangled_func in out69; IMPLIB-NEXT: out{{.*}}_NULL_THUNK_DATA in out70 71 72; Check that using .drectve section has the same effect.73 74; RUN: lld-link -out:out2.dll test.obj loadconfig-arm64ec.obj -dll -noentry -machine:arm64ec drectve.obj75; RUN: llvm-readobj --coff-exports out2.dll | FileCheck --check-prefix=EXP %s76; RUN: llvm-nm --print-armap out2.lib | FileCheck --check-prefix=IMPLIB %s77 78#--- test.s79        .text80        .globl unmangled_func81        .p2align 2, 0x082unmangled_func:83        mov w0, #184        ret85 86        .globl "#mangled_func"87        .p2align 2, 0x088"#mangled_func":89        mov w0, #290        ret91 92        .globl "#exportas_func"93        .p2align 2, 0x094"#exportas_func":95        mov w0, #396        ret97 98        .globl "?cxx_func@@$$hYAHXZ"99        .p2align 2, 0x0100"?cxx_func@@$$hYAHXZ":101        mov w0, #4102        ret103 104        .data105        .globl "#mangled_data_sym"106        .p2align 2, 0x0107"#mangled_data_sym":108        .word 0x01010101109        .globl data_sym110        .p2align 2, 0x0111data_sym:112        .word 0x01010101113 114#--- drectve.s115        .section .drectve, "yn"116        .ascii " -export:unmangled_func"117        .ascii " -export:#mangled_func"118        .ascii " -export:#exportas_func,EXPORTAS,exportas_func"119        .ascii " -export:?cxx_func@@$$hYAHXZ"120        .ascii " -export:data_sym,DATA"121        .ascii " -export:#mangled_data_sym,DATA"122