[lld] r193982 - [PECOFF] Add a test for the resource file.

Rui Ueyama ruiu at google.com
Sun Nov 3 21:17:54 PST 2013


Author: ruiu
Date: Sun Nov  3 23:17:54 2013
New Revision: 193982

URL: http://llvm.org/viewvc/llvm-project?rev=193982&view=rev
Log:
[PECOFF] Add a test for the resource file.

Added:
    lld/trunk/test/pecoff/Inputs/resource.rc
    lld/trunk/test/pecoff/Inputs/resource.res   (with props)
    lld/trunk/test/pecoff/resource.test
Modified:
    lld/trunk/test/lit.cfg

Modified: lld/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg?rev=193982&r1=193981&r2=193982&view=diff
==============================================================================
--- lld/trunk/test/lit.cfg (original)
+++ lld/trunk/test/lit.cfg Sun Nov  3 23:17:54 2013
@@ -134,3 +134,9 @@ if re.search(r'DEBUG', llc_cmd.stdout.re
 if re.search(r'with assertions', llc_cmd.stdout.read()):
     config.available_features.add('asserts')
 llc_cmd.wait()
+
+# Check if Windows resource file compiler exists.
+cvtres = lit.util.which('cvtres', config.environment['PATH'])
+rc = lit.util.which('rc', config.environment['PATH'])
+if cvtres and rc:
+    config.available_features.add('winres')

Added: lld/trunk/test/pecoff/Inputs/resource.rc
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/Inputs/resource.rc?rev=193982&view=auto
==============================================================================
--- lld/trunk/test/pecoff/Inputs/resource.rc (added)
+++ lld/trunk/test/pecoff/Inputs/resource.rc Sun Nov  3 23:17:54 2013
@@ -0,0 +1,4 @@
+STRINGTABLE
+{
+    1, "Hello"
+}

Added: lld/trunk/test/pecoff/Inputs/resource.res
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/Inputs/resource.res?rev=193982&view=auto
==============================================================================
Binary files lld/trunk/test/pecoff/Inputs/resource.res (added) and lld/trunk/test/pecoff/Inputs/resource.res Sun Nov  3 23:17:54 2013 differ

Propchange: lld/trunk/test/pecoff/Inputs/resource.res
------------------------------------------------------------------------------
    svn:executable = *

Added: lld/trunk/test/pecoff/resource.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/resource.test?rev=193982&view=auto
==============================================================================
--- lld/trunk/test/pecoff/resource.test (added)
+++ lld/trunk/test/pecoff/resource.test Sun Nov  3 23:17:54 2013
@@ -0,0 +1,9 @@
+# REQUIRES: winres
+
+# RUN: yaml2obj %p/Inputs/nop.obj.yaml > %t.obj
+#
+# RUN: lld -flavor link /out:%t.exe /subsystem:console /entry:start /opt:noref \
+# RUN:   -- %t.obj %p/Inputs/resource.res
+
+# Check if the binary contains UTF-16 string "Hello" copied from resource.res.
+# cat %t.exe | grep 'H.e.l.l.o'





More information about the llvm-commits mailing list