1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/tools/llvm-rc/language.test
Martin Storsjö 7563d8dfe5 [llvm-rc] Allow specifying language with a leading 0x prefix
This option is always interpreted strictly as a hexadecimal string,
even if it has no prefix that indicates the number format, hence
the existing call to StringRef::getAsInteger(16, ...).

StringRef::getAsInteger(0, ...) consumes a leading "0x" prefix is
present, but when the radix is specified, the radix shouldn't
be included.

Both MS rc.exe and GNU windres accept the language with that
prefix.

Also allow specifying the codepage to llvm-windres with a different
radix, as GNU windres allows that (but MS rc.exe doesn't).

This fixes https://llvm.org/PR51295.

Differential Revision: https://reviews.llvm.org/D107263

(cherry picked from commit 46020f6f0c8aa134002208b2ecf0593b04c46d08)
2021-08-06 12:39:15 -07:00

26 lines
959 B
Plaintext

; RUN: llvm-rc -no-preprocess /l 40A /FO %t.res -- %p/Inputs/language.rc
; RUN: llvm-readobj %t.res | FileCheck %s
; RUN: llvm-rc -no-preprocess /l40A /FO %t.res -- %p/Inputs/language.rc
; RUN: llvm-readobj %t.res | FileCheck %s
; RUN: llvm-windres --no-preprocess -l 40A %p/Inputs/language.rc %t.res
; RUN: llvm-readobj %t.res | FileCheck %s
; RUN: llvm-windres --no-preprocess --language 40A %p/Inputs/language.rc %t.res
; RUN: llvm-readobj %t.res | FileCheck %s
; RUN: llvm-windres --no-preprocess -l 0x40A %p/Inputs/language.rc %t.res
; RUN: llvm-readobj %t.res | FileCheck %s
; CHECK: Resource name (int): 1
; CHECK-NEXT: Data version:
; CHECK-NEXT: Memory flags:
; CHECK-NEXT: Language ID: 2049
; CHECK: Resource name (int): 2
; CHECK-NEXT: Data version:
; CHECK-NEXT: Memory flags:
; CHECK-NEXT: Language ID: 1034
; CHECK: Resource name (int): 3
; CHECK-NEXT: Data version:
; CHECK-NEXT: Memory flags:
; CHECK-NEXT: Language ID: 4099