91 lines · plain
1REQUIRES: aarch64, x862RUN: split-file %s %t.dir && cd %t.dir3 4RUN: llvm-mc -filetype=obj -triple=aarch64-windows arm64-data-sym.s -o arm64-data-sym.obj5RUN: llvm-mc -filetype=obj -triple=arm64ec-windows arm64ec-data-sym.s -o arm64ec-data-sym.obj6RUN: llvm-mc -filetype=obj -triple=x86_64-windows x86_64-data-sym.s -o x86_64-data-sym.obj7RUN: llvm-mc -filetype=obj -triple=i686-windows x86_64-data-sym.s -o i686-data-sym.obj8RUN: llvm-cvtres -machine:arm64x -out:arm64x-resource.obj %S/Inputs/resource.res9 10RUN: lld-link -out:test.dll -machine:arm64ec arm64ec-data-sym.obj -dll -noentry11RUN: llvm-readobj --file-headers test.dll | FileCheck -check-prefix=ARM64EC-HEADER %s12ARM64EC-HEADER: Format: COFF-x86-6413ARM64EC-HEADER-NEXT: Arch: x86_6414ARM64EC-HEADER-NEXT: AddressSize: 64bit15ARM64EC-HEADER: Machine: IMAGE_FILE_MACHINE_AMD64 (0x8664)16 17RUN: lld-link -out:test.dll -machine:arm64x arm64x-resource.obj -dll -noentry18RUN: llvm-readobj --file-headers test.dll | FileCheck -check-prefix=ARM64X-HEADER %s19ARM64X-HEADER: Machine: IMAGE_FILE_MACHINE_ARM64 (0xAA64)20 21arm64x object files are allowed with -machine:arm64 as well22RUN: lld-link -out:test.dll -machine:arm64 arm64x-resource.obj -dll -noentry23 24RUN: lld-link -out:test.dll -machine:arm64ec arm64ec-data-sym.obj x86_64-data-sym.obj \25RUN: arm64x-resource.obj -dll -noentry26RUN: llvm-readobj --file-headers test.dll | FileCheck -check-prefix=ARM64EC-HEADER %s27 28RUN: llvm-readobj --hex-dump=.data test.dll | FileCheck -check-prefix=ARM64EC-DATA %s29ARM64EC-DATA: 02020202 0303030330 31RUN: lld-link -out:test.dll -machine:arm64x x86_64-data-sym.obj arm64-data-sym.obj \32RUN: arm64ec-data-sym.obj arm64x-resource.obj -dll -noentry33RUN: llvm-readobj --file-headers test.dll | FileCheck -check-prefix=ARM64X-HEADER %s34 35RUN: llvm-readobj --hex-dump=.data test.dll | FileCheck -check-prefix=ARM64X-DATA %s36ARM64X-DATA: 03030303 01010101 0202020237 38RUN: lld-link -out:test.dll -machine:arm64ec x86_64-data-sym.obj arm64-data-sym.obj \39RUN: arm64ec-data-sym.obj arm64x-resource.obj -dll -noentry40RUN: llvm-readobj --file-headers test.dll | FileCheck -check-prefix=ARM64EC-HEADER %s41RUN: llvm-readobj --hex-dump=.data test.dll | FileCheck -check-prefix=ARM64X-DATA %s42 43RUN: not lld-link -out:test.dll -machine:arm64 arm64-data-sym.obj arm64ec-data-sym.obj \44RUN: -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT1 %s45INCOMPAT1: lld-link: error: arm64ec-data-sym.obj: machine type arm64ec conflicts with arm6446 47RUN: not lld-link -out:test.dll -machine:arm64 arm64-data-sym.obj x86_64-data-sym.obj \48RUN: -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT3 %s49INCOMPAT3: lld-link: error: x86_64-data-sym.obj: machine type x64 conflicts with arm6450 51arm64ec machine type can't be inferred, it must be specified explicitly.52RUN: not lld-link -out:test.dll arm64ec-data-sym.obj \53RUN: -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT4 %s54INCOMPAT4: lld-link: error: arm64ec-data-sym.obj: machine type arm64ec is ambiguous and cannot be inferred, use /machine:arm64ec or /machine:arm64x55 56RUN: not lld-link -out:test.dll x86_64-data-sym.obj arm64ec-data-sym.obj \57RUN: -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT4 %s58 59RUN: not lld-link -out:test.dll arm64-data-sym.obj arm64ec-data-sym.obj \60RUN: -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT4 %s61 62RUN: not lld-link -out:test.dll i686-data-sym.obj arm64ec-data-sym.obj \63RUN: -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT5 %s64INCOMPAT5: lld-link: error: arm64ec-data-sym.obj: machine type arm64ec conflicts with x8665 66arm64x can be inferred and when mixed with ARM64, the first one wins67RUN: lld-link -out:test.dll -dll -noentry arm64x-resource.obj arm64-data-sym.obj x86_64-data-sym.obj arm64ec-data-sym.obj68RUN: not lld-link -out:test.dll -dll -noentry arm64-data-sym.obj arm64x-resource.obj x86_64-data-sym.obj 2>&1 | FileCheck -check-prefix=INCOMPAT3 %s69RUN: not lld-link -out:test.dll -dll -noentry arm64-data-sym.obj arm64x-resource.obj arm64ec-data-sym.obj 2>&1 | FileCheck -check-prefix=INCOMPAT4 %s70 71#--- arm64ec-data-sym.s72 .data73 .globl arm64ec_data_sym74 .p2align 2, 0x075arm64ec_data_sym:76 .word 0x0202020277 78#--- arm64-data-sym.s79 .data80 .globl arm64_data_sym81 .p2align 2, 0x082arm64_data_sym:83 .word 0x0101010184 85#--- x86_64-data-sym.s86 .data87 .globl x86_64_data_sym88 .p2align 2, 0x089x86_64_data_sym:90 .long 0x0303030391