1 REQUIRES: aarch64-registered-target
5 RUN: rm -rf %t && mkdir -p %t
6 RUN: llvm-mc -triple=i386-pc-windows-msvc -filetype=obj -o %t/i386.obj %S/Inputs/a.s
7 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/x86_64.obj %S/Inputs/a.s
8 RUN: llvm-mc -triple=aarch64-pc-windows-msvc -filetype=obj -o %t/arm64.obj %S/Inputs/a.s
9 RUN: llvm-mc -triple=arm64ec-pc-windows-msvc -filetype=obj -o %t/arm64ec.obj %S/Inputs/a.s
10 RUN: llvm-as -o %t/i386.bc %S/Inputs/i386.ll
11 RUN: llvm-as -o %t/x86_64.bc %S/Inputs/x86_64.ll
12 RUN: llvm-as -o %t/arm64.bc %S/Inputs/arm64.ll
13 RUN: yaml2obj -o %t/arm64x.obj %S/Inputs/arm64x.yaml
16 Mixing bitcode and normal object files with the same machine type is ok:
18 RUN: llvm-lib %t/i386.obj %t/i386.bc
19 RUN: llvm-lib %t/x86_64.obj %t/x86_64.bc
22 As is including resource files:
24 RUN: llvm-lib /out:%t.lib %S/Inputs/resource.res %t/i386.obj %t/i386.bc
25 RUN: llvm-lib /out:%t.lib %t/x86_64.obj %S/Inputs/resource.res %t/x86_64.bc
28 Mixing object files with different machine type is not ok:
30 RUN: not llvm-lib %t/x86_64.obj %t/i386.obj 2>&1 | \
31 RUN: FileCheck --check-prefix=OBJ32 %s
32 OBJ32: i386.obj: file machine type x86 conflicts with library machine type x64 (inferred from earlier file '{{.*}}x86_64.obj')
35 Neither is mixing object and bitcode files with different machine type:
37 RUN: not llvm-lib %t/x86_64.obj %t/i386.bc 2>&1 | \
38 RUN: FileCheck --check-prefix=BC32 %s
39 BC32: i386.bc: file machine type x86 conflicts with library machine type x64 (inferred from earlier file '{{.*}}x86_64.obj')
41 RUN: not llvm-lib %t/arm64.bc %t/x86_64.bc 2>&1 | \
42 RUN: FileCheck --check-prefix=BC64 %s
43 BC64: x86_64.bc: file machine type x64 conflicts with library machine type arm64 (inferred from earlier file '{{.*}}arm64.bc')
46 If /machine: is passed, its value is authoritative.
48 RUN: not llvm-lib /machine:X86 %t/x86_64.obj %t/i386.obj 2>&1 | \
49 RUN: FileCheck --check-prefix=OBJ64 %s
50 OBJ64: x86_64.obj: file machine type x64 conflicts with library machine type x86 (from '/machine:X86' flag)
53 Mixing arm64 and x86_64 is possible using arm64ec:
55 RUN: llvm-lib -machine:arm64ec %t/arm64.bc %t/x86_64.bc %t/arm64.obj %t/x86_64.obj %t/arm64ec.obj %t/arm64x.obj
56 RUN: llvm-lib -machine:arm64x %t/arm64.bc %t/x86_64.bc %t/arm64.obj %t/x86_64.obj %t/arm64ec.obj %t/arm64x.obj
57 RUN: llvm-lib -machine:arm64 %t/arm64.bc %t/arm64.obj %t/arm64x.obj
59 RUN: not llvm-lib %t/arm64ec.obj 2>&1 | FileCheck --check-prefix=NOEC %s
60 NOEC: arm64ec.obj: file machine type arm64ec conflicts with inferred library machine type, use /machine:arm64ec or /machine:arm64x
62 RUN: not llvm-lib -machine:arm64ec %t/arm64ec.obj %t/i386.obj 2>&1 | \
63 RUN: FileCheck --check-prefix=OBJEC %s
64 RUN: not llvm-lib -machine:arm64x %t/arm64ec.obj %t/i386.obj 2>&1 | \
65 RUN: FileCheck --check-prefix=OBJX %s
66 RUN: not llvm-lib -machine:x64 %t/x86_64.obj %t/arm64x.obj 2>&1 | \
67 RUN: FileCheck --check-prefix=OBJX2 %s
68 OBJEC: i386.obj: file machine type x86 conflicts with library machine type arm64ec (from '/machine:arm64ec' flag)
69 OBJX: i386.obj: file machine type x86 conflicts with library machine type arm64x (from '/machine:arm64x' flag)
70 OBJX2: arm64x.obj: file machine type arm64x conflicts with library machine type x64 (from '/machine:x64' flag)
72 RUN: not llvm-lib -machine:arm64ec %t/arm64.bc %t/x86_64.bc %t/i386.bc 2>&1 | \
73 RUN: FileCheck --check-prefix=BCEC %s
74 RUN: not llvm-lib -machine:arm64x %t/arm64.bc %t/x86_64.bc %t/i386.bc 2>&1 | \
75 RUN: FileCheck --check-prefix=BCX %s
76 BCEC: i386.bc: file machine type x86 conflicts with library machine type arm64ec (from '/machine:arm64ec' flag)
77 BCX: i386.bc: file machine type x86 conflicts with library machine type arm64x (from '/machine:arm64x' flag)