[llvm-objdump] - Remove one overload of reportError. NFCI.
[llvm-complete.git] / test / tools / llvm-lib / machine-mismatch.test
blob43a0f7ae75f689b4a1c59173d0244fcf05cc3580
1 Prepare inputs:
3 RUN: rm -rf %t && mkdir -p %t
4 RUN: llvm-mc -triple=i386-pc-windows-msvc -filetype=obj -o %t/i386.obj %S/Inputs/a.s
5 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/x86_64.obj %S/Inputs/a.s
6 RUN: llvm-as -o %t/i386.bc %S/Inputs/i386.ll
7 RUN: llvm-as -o %t/x86_64.bc %S/Inputs/x86_64.ll
8 RUN: llvm-as -o %t/arm64.bc %S/Inputs/arm64.ll
11 Mixing bitcode and normal object files with the same machine type is ok:
13 RUN: llvm-lib %t/i386.obj %t/i386.bc
14 RUN: llvm-lib %t/x86_64.obj %t/x86_64.bc
17 As is including resource files:
19 RUN: llvm-lib /out:%t.lib %S/Inputs/resource.res %t/i386.obj %t/i386.bc
20 RUN: llvm-lib /out:%t.lib %t/x86_64.obj %S/Inputs/resource.res %t/x86_64.bc
23 Mixing object files with different machine type is not ok:
25 RUN: not llvm-lib %t/x86_64.obj %t/i386.obj 2>&1 | \
26 RUN:     FileCheck --check-prefix=OBJ32 %s
27 OBJ32: i386.obj: file machine type x86 conflicts with library machine type x64 (inferred from earlier file '{{.*}}x86_64.obj')
30 Neither is mixing object and bitcode files with different machine type:
32 RUN: not llvm-lib %t/x86_64.obj %t/i386.bc 2>&1 | \
33 RUN:     FileCheck --check-prefix=BC32 %s
34 BC32: i386.bc: file machine type x86 conflicts with library machine type x64 (inferred from earlier file '{{.*}}x86_64.obj')
36 RUN: not llvm-lib %t/arm64.bc %t/x86_64.bc 2>&1 | \
37 RUN:     FileCheck --check-prefix=BC64 %s
38 BC64: x86_64.bc: file machine type x64 conflicts with library machine type arm64 (inferred from earlier file '{{.*}}arm64.bc')
41 If /machine: is passed, its value is authoritative.
43 RUN: not llvm-lib /machine:X86 %t/x86_64.obj %t/i386.obj 2>&1 | \
44 RUN:     FileCheck --check-prefix=OBJ64 %s
45 OBJ64: x86_64.obj: file machine type x64 conflicts with library machine type x86 (from '/machine:X86' flag)