File: machine-mismatch.test

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,388 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (45 lines) | stat: -rw-r--r-- 1,772 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Prepare inputs:

RUN: rm -rf %t && mkdir -p %t
RUN: llvm-mc -triple=i386-pc-windows-msvc -filetype=obj -o %t/i386.obj %S/Inputs/a.s
RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/x86_64.obj %S/Inputs/a.s
RUN: llvm-as -o %t/i386.bc %S/Inputs/i386.ll
RUN: llvm-as -o %t/x86_64.bc %S/Inputs/x86_64.ll
RUN: llvm-as -o %t/arm64.bc %S/Inputs/arm64.ll


Mixing bitcode and normal object files with the same machine type is ok:

RUN: llvm-lib %t/i386.obj %t/i386.bc
RUN: llvm-lib %t/x86_64.obj %t/x86_64.bc


As is including resource files:

RUN: llvm-lib /out:%t.lib %S/Inputs/resource.res %t/i386.obj %t/i386.bc
RUN: llvm-lib /out:%t.lib %t/x86_64.obj %S/Inputs/resource.res %t/x86_64.bc


Mixing object files with different machine type is not ok:

RUN: not llvm-lib %t/x86_64.obj %t/i386.obj 2>&1 | \
RUN:     FileCheck --check-prefix=OBJ32 %s
OBJ32: i386.obj: file machine type x86 conflicts with library machine type x64 (inferred from earlier file '{{.*}}x86_64.obj')


Neither is mixing object and bitcode files with different machine type:

RUN: not llvm-lib %t/x86_64.obj %t/i386.bc 2>&1 | \
RUN:     FileCheck --check-prefix=BC32 %s
BC32: i386.bc: file machine type x86 conflicts with library machine type x64 (inferred from earlier file '{{.*}}x86_64.obj')

RUN: not llvm-lib %t/arm64.bc %t/x86_64.bc 2>&1 | \
RUN:     FileCheck --check-prefix=BC64 %s
BC64: x86_64.bc: file machine type x64 conflicts with library machine type arm64 (inferred from earlier file '{{.*}}arm64.bc')


If /machine: is passed, its value is authoritative.

RUN: not llvm-lib /machine:X86 %t/x86_64.obj %t/i386.obj 2>&1 | \
RUN:     FileCheck --check-prefix=OBJ64 %s
OBJ64: x86_64.obj: file machine type x64 conflicts with library machine type x86 (from '/machine:X86' flag)