Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / COFF / arm64ec.test
blobe50b14ce0184c89398be15710e5c286324820185
1 REQUIRES: aarch64, x86
2 RUN: split-file %s %t.dir && cd %t.dir
4 RUN: llvm-mc -filetype=obj -triple=aarch64-windows arm64-data-sym.s -o arm64-data-sym.obj
5 RUN: llvm-mc -filetype=obj -triple=arm64ec-windows arm64ec-data-sym.s -o arm64ec-data-sym.obj
6 RUN: llvm-mc -filetype=obj -triple=x86_64-windows x86_64-data-sym.s -o x86_64-data-sym.obj
7 RUN: llvm-cvtres -machine:arm64x -out:arm64x-resource.obj %S/Inputs/resource.res
9 RUN: lld-link -out:test.dll -machine:arm64ec arm64ec-data-sym.obj -dll -noentry
10 RUN: llvm-readobj --file-headers test.dll | FileCheck -check-prefix=ARM64EC-HEADER %s
11 ARM64EC-HEADER:      Format: COFF-x86-64
12 ARM64EC-HEADER-NEXT: Arch: x86_64
13 ARM64EC-HEADER-NEXT: AddressSize: 64bit
14 ARM64EC-HEADER:      Machine: IMAGE_FILE_MACHINE_AMD64 (0x8664)
16 RUN: lld-link -out:test.dll -machine:arm64x arm64x-resource.obj -dll -noentry
17 RUN: llvm-readobj --file-headers test.dll | FileCheck -check-prefix=ARM64X-HEADER %s
18 ARM64X-HEADER:      Machine: IMAGE_FILE_MACHINE_ARM64 (0xAA64)
20 arm64x object files are allowed with -machine:arm64 as well
21 RUN: lld-link -out:test.dll -machine:arm64 arm64x-resource.obj -dll -noentry
23 RUN: lld-link -out:test.dll -machine:arm64ec arm64ec-data-sym.obj x86_64-data-sym.obj \
24 RUN:          arm64x-resource.obj -dll -noentry
25 RUN: llvm-readobj --file-headers test.dll | FileCheck -check-prefix=ARM64EC-HEADER %s
27 RUN: llvm-readobj --hex-dump=.data test.dll | FileCheck -check-prefix=ARM64EC-DATA %s
28 ARM64EC-DATA: 02020202 03030303
30 RUN: lld-link -out:test.dll -machine:arm64x x86_64-data-sym.obj arm64-data-sym.obj \
31 RUN:          arm64ec-data-sym.obj arm64x-resource.obj -dll -noentry
32 RUN: llvm-readobj --file-headers test.dll | FileCheck -check-prefix=ARM64X-HEADER %s
34 RUN: llvm-readobj --hex-dump=.data test.dll | FileCheck -check-prefix=ARM64X-DATA %s
35 ARM64X-DATA: 03030303 01010101 02020202
37 RUN: not lld-link -out:test.dll -machine:arm64 arm64-data-sym.obj arm64ec-data-sym.obj \
38 RUN:              -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT1 %s
39 INCOMPAT1: lld-link: error: arm64ec-data-sym.obj: machine type arm64ec conflicts with arm64
41 RUN: not lld-link -out:test.dll -machine:arm64ec arm64ec-data-sym.obj arm64-data-sym.obj \
42 RUN:              -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT2 %s
43 INCOMPAT2: lld-link: error: arm64-data-sym.obj: machine type arm64 conflicts with arm64ec
45 RUN: not lld-link -out:test.dll -machine:arm64 arm64-data-sym.obj x86_64-data-sym.obj \
46 RUN:              -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT3 %s
47 INCOMPAT3: lld-link: error: x86_64-data-sym.obj: machine type x64 conflicts with arm64
49 #--- arm64ec-data-sym.s
50     .data
51     .globl arm64ec_data_sym
52     .p2align 2, 0x0
53 arm64ec_data_sym:
54     .word 0x02020202
56 #--- arm64-data-sym.s
57     .data
58     .globl arm64_data_sym
59     .p2align 2, 0x0
60 arm64_data_sym:
61     .word 0x01010101
63 #--- x86_64-data-sym.s
64     .data
65     .globl x86_64_data_sym
66     .p2align 2, 0x0
67 x86_64_data_sym:
68     .long 0x03030303