mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
2a1f29ca9f
This primarily parses a different set of options and invokes the same resource compiler as llvm-rc normally. Additionally, it can convert directly to an object file (which in MSVC style setups is done with the separate cvtres tool, or by the linker). (GNU windres also supports other conversions; from coff object file back to .res, and from .res or object file back to .rc form; that's not yet implemented.) The other bigger complication lies in being able to imply or pass the intended target triple, to let clang find the corresponding mingw sysroot for finding include files, and for specifying the default output object machine format. It can be implied from the tool triple prefix, like `<triple>-[llvm-]windres` or picked up from the windres option e.g. `-F pe-x86-64`. In GNU windres, that option takes BFD style format names such as pe-i386 or pe-x86-64. As libbfd in binutils doesn't support Windows on ARM, there's no such canonical name for the ARM targets. Therefore, as an LLVM specific extension, this option is extended to allow passing full triples, too. Differential Revision: https://reviews.llvm.org/D100756
51 lines
2.5 KiB
Plaintext
51 lines
2.5 KiB
Plaintext
; RUN: llvm-rc -no-preprocess /C 65001 /FO %t.utf8.res -- %p/Inputs/utf8.rc
|
|
; RUN: llvm-readobj %t.utf8.res | FileCheck %s --check-prefix=UTF8
|
|
; RUN: llvm-windres --no-preprocess -c 65001 %p/Inputs/utf8.rc %t.utf8.res
|
|
; RUN: llvm-readobj %t.utf8.res | FileCheck %s --check-prefix=UTF8
|
|
; RUN: llvm-windres --no-preprocess --codepage 65001 %p/Inputs/utf8.rc %t.utf8.res
|
|
; RUN: llvm-readobj %t.utf8.res | FileCheck %s --check-prefix=UTF8
|
|
|
|
; UTF8: Resource type (int): STRINGTABLE (ID 6)
|
|
; UTF8-NEXT: Resource name (int): 1
|
|
; UTF8-NEXT: Data version: 0
|
|
; UTF8-NEXT: Memory flags: 0x1030
|
|
; UTF8-NEXT: Language ID: 1033
|
|
; UTF8-NEXT: Version (major): 0
|
|
; UTF8-NEXT: Version (minor): 0
|
|
; UTF8-NEXT: Characteristics: 0
|
|
; UTF8-NEXT: Data size: 68
|
|
; UTF8-NEXT: Data: (
|
|
; UTF8-NEXT: 0000: 00000700 E500E400 F6002000 A9002000 |.......... ... .|
|
|
; UTF8-NEXT: 0010: 61000B00 E500E400 F6002000 A9002000 |a......... ... .|
|
|
; UTF8-NEXT: 0020: E500E400 F6002000 A9000000 00000000 |...... .........|
|
|
; UTF8-NEXT: 0030: 00000000 00000000 00000000 00000000 |................|
|
|
; UTF8-NEXT: 0040: 00000000 |....|
|
|
; UTF8-NEXT: )
|
|
|
|
; RUN: not llvm-rc -no-preprocess /C 65001 /FO %t.utf8-escape-narrow.res -- %p/Inputs/utf8-escape-narrow.rc 2>&1 | FileCheck %s --check-prefix UTF8_ESCAPE
|
|
; UTF8_ESCAPE: llvm-rc: Error in STRINGTABLE statement (ID 1):
|
|
; UTF8_ESCAPE-NEXT: Unable to interpret single byte (195) as UTF-8
|
|
|
|
; RUN: llvm-rc -no-preprocess /C 1252 /FO %t.cp1252.res -- %p/Inputs/cp1252.rc
|
|
; RUN: llvm-readobj %t.cp1252.res | FileCheck %s --check-prefix=CP1252
|
|
; RUN: llvm-windres --no-preprocess -c 1252 %p/Inputs/cp1252.rc %t.cp1252.res
|
|
; RUN: llvm-readobj %t.cp1252.res | FileCheck %s --check-prefix=CP1252
|
|
|
|
; CP1252: Resource type (int): STRINGTABLE (ID 6)
|
|
; CP1252-NEXT: Resource name (int): 1
|
|
; CP1252-NEXT: Data version: 0
|
|
; CP1252-NEXT: Memory flags: 0x1030
|
|
; CP1252-NEXT: Language ID: 1033
|
|
; CP1252-NEXT: Version (major): 0
|
|
; CP1252-NEXT: Version (minor): 0
|
|
; CP1252-NEXT: Characteristics: 0
|
|
; CP1252-NEXT: Data size: 92
|
|
; CP1252-NEXT: Data: (
|
|
; CP1252-NEXT: 0000: 00000F00 E500E400 F6002000 A9002000 |.......... ... .|
|
|
; CP1252-NEXT: 0010: 92012000 E500E400 F6002000 A9002000 |.. ....... ... .|
|
|
; CP1252-NEXT: 0020: 92010F00 E500E400 F6002000 A9002000 |.......... ... .|
|
|
; CP1252-NEXT: 0030: 92012000 E500E400 F6002000 A9002000 |.. ....... ... .|
|
|
; CP1252-NEXT: 0040: 92010000 00000000 00000000 00000000 |................|
|
|
; CP1252-NEXT: 0050: 00000000 00000000 00000000 |............|
|
|
; CP1252-NEXT: )
|