1 // Check that cvtres properly generates COFF for different machine types. The
2 // only things that changes with machine type are the machine constant listed
3 // in the COFF header, and the relocation types in the relocation tables.
4 // The input was generated with the following command, using the original Windows
6 // > rc /fo test_resource.res /nologo test_resource.rc
7 // The object files we are comparing against were generated with these commands
8 // using the original Windows cvtres.exe.
9 // > cvtres /machine:X86 /readonly /nologo /out:test_resource.obj.coff \
11 // > cvtres /machine:X64 /readonly /nologo /out:test_resource.obj.coff.x64 \
13 // > cvtres /machine:ARM /readonly /nologo /out:test_resource.obj.coff.x64 \
16 RUN: llvm-cvtres /machine:X86 /out:%t %p/Inputs/test_resource.res
17 RUN: llvm-readobj -h -r %t | FileCheck %s -check-prefix=X86
19 RUN: llvm-cvtres /machine:X64 /out:%t %p/Inputs/test_resource.res
20 RUN: llvm-readobj -h -r %t | FileCheck %s -check-prefix=X64
22 RUN: llvm-cvtres /machine:ARM /out:%t %p/Inputs/test_resource.res
23 RUN: llvm-readobj -h -r %t | FileCheck %s -check-prefix=ARM
25 RUN: llvm-cvtres /machine:ARM64 /out:%t %p/Inputs/test_resource.res
26 RUN: llvm-readobj -h -r %t | FileCheck %s -check-prefix=ARM64
28 X86: Machine: IMAGE_FILE_MACHINE_I386 (0x14C)
29 X86-DAG: Relocations [
31 X86-NEXT: 0x1E8 IMAGE_REL_I386_DIR32NB $R000000
32 X86-NEXT: 0x198 IMAGE_REL_I386_DIR32NB $R000001
33 X86-NEXT: 0x1A8 IMAGE_REL_I386_DIR32NB $R000002
34 X86-NEXT: 0x1C8 IMAGE_REL_I386_DIR32NB $R000003
35 X86-NEXT: 0x1D8 IMAGE_REL_I386_DIR32NB $R000004
36 X86-NEXT: 0x1F8 IMAGE_REL_I386_DIR32NB $R000005
37 X86-NEXT: 0x1B8 IMAGE_REL_I386_DIR32NB $R000006
38 X86-NEXT: 0x188 IMAGE_REL_I386_DIR32NB $R000007
40 X64: Machine: IMAGE_FILE_MACHINE_AMD64 (0x8664)
41 X64-DAG: Relocations [
43 X64-NEXT: 0x1E8 IMAGE_REL_AMD64_ADDR32NB $R000000
44 X64-NEXT: 0x198 IMAGE_REL_AMD64_ADDR32NB $R000001
45 X64-NEXT: 0x1A8 IMAGE_REL_AMD64_ADDR32NB $R000002
46 X64-NEXT: 0x1C8 IMAGE_REL_AMD64_ADDR32NB $R000003
47 X64-NEXT: 0x1D8 IMAGE_REL_AMD64_ADDR32NB $R000004
48 X64-NEXT: 0x1F8 IMAGE_REL_AMD64_ADDR32NB $R000005
49 X64-NEXT: 0x1B8 IMAGE_REL_AMD64_ADDR32NB $R000006
50 X64-NEXT: 0x188 IMAGE_REL_AMD64_ADDR32NB $R000007
52 ARM: Machine: IMAGE_FILE_MACHINE_ARMNT (0x1C4)
53 ARM-DAG: Relocations [
55 ARM-NEXT: 0x1E8 IMAGE_REL_ARM_ADDR32NB $R000000
56 ARM-NEXT: 0x198 IMAGE_REL_ARM_ADDR32NB $R000001
57 ARM-NEXT: 0x1A8 IMAGE_REL_ARM_ADDR32NB $R000002
58 ARM-NEXT: 0x1C8 IMAGE_REL_ARM_ADDR32NB $R000003
59 ARM-NEXT: 0x1D8 IMAGE_REL_ARM_ADDR32NB $R000004
60 ARM-NEXT: 0x1F8 IMAGE_REL_ARM_ADDR32NB $R000005
61 ARM-NEXT: 0x1B8 IMAGE_REL_ARM_ADDR32NB $R000006
62 ARM-NEXT: 0x188 IMAGE_REL_ARM_ADDR32NB $R000007
64 ARM64: Machine: IMAGE_FILE_MACHINE_ARM64 (0xAA64)
65 ARM64-DAG: Relocations [
67 ARM64-NEXT: 0x1E8 IMAGE_REL_ARM64_ADDR32NB $R000000
68 ARM64-NEXT: 0x198 IMAGE_REL_ARM64_ADDR32NB $R000001
69 ARM64-NEXT: 0x1A8 IMAGE_REL_ARM64_ADDR32NB $R000002
70 ARM64-NEXT: 0x1C8 IMAGE_REL_ARM64_ADDR32NB $R000003
71 ARM64-NEXT: 0x1D8 IMAGE_REL_ARM64_ADDR32NB $R000004
72 ARM64-NEXT: 0x1F8 IMAGE_REL_ARM64_ADDR32NB $R000005
73 ARM64-NEXT: 0x1B8 IMAGE_REL_ARM64_ADDR32NB $R000006
74 ARM64-NEXT: 0x188 IMAGE_REL_ARM64_ADDR32NB $R000007