From 11adbacac86a740724d3bfe8f7de6563bf71a617 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 15 May 2018 06:35:29 +0000 Subject: [llvm-rc] Add support for parsing memory flags Most of the handling is pretty straightforward; fetch the default memory flags for the specific resource type before parsing the flags and apply them on top of that, except that some flags imply others and some flags clear more than one flag. For icons and cursors, the flags set get passed on to all individual single icon/cursor resources, while only some flags affect the icon/cursor group resource. For stringtables, the behaviour is pretty simple; the first stringtable resource of a bundle sets the flags for the whole bundle. The output of these tests match rc.exe byte for byte. The actual use of these memory flags is deprecated and they have no effect since Win16, but some resource script files may still happen to have them in place. Differential Revision: https://reviews.llvm.org/D46818 llvm-svn: 332329 --- llvm/test/tools/llvm-rc/memoryflags-stringtable.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 llvm/test/tools/llvm-rc/memoryflags-stringtable.test (limited to 'llvm/test/tools/llvm-rc/memoryflags-stringtable.test') diff --git a/llvm/test/tools/llvm-rc/memoryflags-stringtable.test b/llvm/test/tools/llvm-rc/memoryflags-stringtable.test new file mode 100644 index 00000000000..f168beda7b9 --- /dev/null +++ b/llvm/test/tools/llvm-rc/memoryflags-stringtable.test @@ -0,0 +1,15 @@ +; RUN: llvm-rc /FO %t %p/Inputs/memoryflags-stringtable.rc +; RUN: llvm-readobj %t | FileCheck %s + +; CHECK: Resource type (int): 6 +; CHECK-NEXT: Resource name (int): 1 +; CHECK-NEXT: Data version: 0 +; CHECK-NEXT: Memory flags: 0x10 +; CHECK: Resource type (int): 6 +; CHECK-NEXT: Resource name (int): 1 +; CHECK-NEXT: Data version: 0 +; CHECK-NEXT: Memory flags: 0x1030 +; CHECK: Resource type (int): 6 +; CHECK-NEXT: Resource name (int): 1 +; CHECK-NEXT: Data version: 0 +; CHECK-NEXT: Memory flags: 0x60 -- cgit v1.2.3