68 lines · plain
1// REQUIRES: aarch642// RUN: split-file %s %t.dir && cd %t.dir3 4// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows sym-arm64ec.s -o sym-arm64ec.obj5// RUN: llvm-mc -filetype=obj -triple=aarch64-windows sym-aarch64.s -o sym-aarch64.obj6// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows drectve.s -o drectve-arm64ec.obj7// RUN: llvm-mc -filetype=obj -triple=aarch64-windows drectve.s -o drectve-aarch64.obj8// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o loadconfig-arm64ec.obj9// RUN: llvm-mc -filetype=obj -triple=aarch64-windows %S/Inputs/loadconfig-arm64.s -o loadconfig-arm64.obj10// RUN: llvm-lib -machine:arm64x -out:sym.lib sym-arm64ec.obj sym-aarch64.obj11 12// Check that the command-line -include argument ensures the EC symbol is included.13 14// RUN: lld-link -machine:arm64x -out:out-arg.dll -dll -noentry loadconfig-arm64.obj loadconfig-arm64ec.obj sym.lib -include:sym15// RUN: llvm-readobj --hex-dump=.test out-arg.dll | FileCheck --check-prefix=EC %s16// EC: 0x180004000 02000000 ....17 18// Check that the native .drectve -include argument ensures the native symbol is included.19 20// RUN: lld-link -machine:arm64x -out:out-native.dll -dll -noentry loadconfig-arm64.obj loadconfig-arm64ec.obj sym.lib drectve-aarch64.obj21// RUN: llvm-readobj --hex-dump=.test out-native.dll | FileCheck --check-prefix=NATIVE %s22// NATIVE: 0x180004000 01000000 ....23 24// Check that the EC .drectve -include argument ensures the EC symbol is included.25 26// RUN: lld-link -machine:arm64x -out:out-ec.dll -dll -noentry loadconfig-arm64.obj loadconfig-arm64ec.obj sym.lib drectve-arm64ec.obj27// RUN: llvm-readobj --hex-dump=.test out-ec.dll | FileCheck --check-prefix=EC %s28 29// Check that both native and EC .drectve -include arguments ensure both symbols are included.30 31// RUN: lld-link -machine:arm64x -out:out-arg-native.dll -dll -noentry loadconfig-arm64.obj loadconfig-arm64ec.obj sym.lib \32// RUN: -include:sym drectve-aarch64.obj33// RUN: llvm-readobj --hex-dump=.test out-arg-native.dll | FileCheck --check-prefix=BOTH %s34// BOTH: 0x180004000 02000000 01000000 ........35 36// RUN: lld-link -machine:arm64x -out:out-both.dll -dll -noentry loadconfig-arm64.obj loadconfig-arm64ec.obj sym.lib \37// RUN: drectve-arm64ec.obj drectve-aarch64.obj38// RUN: llvm-readobj --hex-dump=.test out-both.dll | FileCheck --check-prefix=BOTH %s39 40// Check that including a missing symbol results in an error.41 42// RUN: not lld-link -machine:arm64x -out:err.dll -dll -noentry loadconfig-arm64.obj loadconfig-arm64ec.obj -include:sym sym-aarch64.obj \43// RUN: 2>&1 | FileCheck --check-prefix=ERR-EC %s44// ERR-EC: lld-link: error: <root>: undefined symbol: sym (EC symbol)45 46// RUN: not lld-link -machine:arm64x -out:err.dll -dll -noentry loadconfig-arm64.obj loadconfig-arm64ec.obj drectve-arm64ec.obj sym-aarch64.obj \47// RUN: 2>&1 | FileCheck --check-prefix=ERR-EC %s48 49// RUN: not lld-link -machine:arm64x -out:err.dll -dll -noentry loadconfig-arm64.obj loadconfig-arm64ec.obj drectve-aarch64.obj sym-arm64ec.obj \50// RUN: 2>&1 | FileCheck --check-prefix=ERR-NATIVE %s51// ERR-NATIVE: lld-link: error: <root>: undefined symbol: sym (native symbol)52 53#--- sym-aarch64.s54 .section ".test","dr"55 .globl sym56sym:57 .word 158 59#--- sym-arm64ec.s60 .section ".test","dr"61 .globl sym62sym:63 .word 264 65#--- drectve.s66 .section .drectve, "yn"67 .ascii " -include:sym"68