xref: /llvm-project/llvm/test/tools/llvm-rc/windres-format.test (revision f8de9aaef2f472ad7572748582444083d31d5a95)
1; Check that the various input/output formats (rc/res/coff) are implied
2; from file suffixes.
3
4; RUN: rm -f %t.res
5; RUN: llvm-windres --no-preprocess %p/Inputs/tag-stringtable-basic.rc %t.res
6; RUN: llvm-readobj %t.res | FileCheck %s --check-prefix=CHECK-RES
7
8; RUN: rm -f %t.o
9; RUN: llvm-windres --no-preprocess -F pe-x86-64 %p/Inputs/tag-stringtable-basic.rc %t.o
10; RUN: llvm-readobj --coff-resources %t.o | FileCheck %s --check-prefix=CHECK-OBJ
11
12; RUN: rm -f %t.obj
13; RUN: llvm-windres -F pe-x86-64 %t.res %t.obj
14; RUN: llvm-readobj --coff-resources %t.obj | FileCheck %s --check-prefix=CHECK-OBJ
15
16; Check that we can specify the input/output file types explicitly.
17; Also check options for specifying the input/output file names.
18
19; RUN: cat %p/Inputs/tag-stringtable-basic.rc > %t-anonymous
20; RUN: rm -f %t-anonymous2
21; RUN: llvm-windres --no-preprocess -O res -J rc -o %t-anonymous2 -i %t-anonymous
22; RUN: llvm-readobj %t-anonymous2 | FileCheck %s --check-prefix=CHECK-RES
23
24; RUN: rm -f %t-anonymous3
25; RUN: llvm-windres -F pe-x86-64 -J res -O coff -i%t-anonymous2 -o%t-anonymous3
26; RUN: llvm-readobj --coff-resources %t-anonymous3 | FileCheck %s --check-prefix=CHECK-OBJ
27
28; CHECK-RES: Resource type (int): STRINGTABLE
29
30; CHECK-OBJ: Format: COFF-x86-64
31; CHECK-OBJ: Resources [
32; CHECK-OBJ:   Total Number of Resources:
33
34; Check for format conversions that currently aren't supported.
35
36; RUN: not llvm-windres -F pe-x86-64 -J res -O rc -i%t-anonymous2 -o%t-anonymous 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR-OUTPUT
37; RUN: not llvm-windres -F pe-x86-64 -J coff -O res -i%t-anonymous3 -o%t-anonymous2 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR-INPUT
38
39; CHECK-ERROR-OUTPUT: Unsupported output format
40; CHECK-ERROR-INPUT: Unsupported input format
41