aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-11-04 05:17:54 +0000
committerRui Ueyama <ruiu@google.com>2013-11-04 05:17:54 +0000
commitf23b27a837a005c193106c346e139b74a064ec19 (patch)
treeb8d5312a871db5d8c9bdc92807d16c11a74a20f8
parent2c717faa19a6b1e5d33331c0c0ed129ea7c944f1 (diff)
downloadllvm-f23b27a837a005c193106c346e139b74a064ec19.zip
llvm-f23b27a837a005c193106c346e139b74a064ec19.tar.gz
llvm-f23b27a837a005c193106c346e139b74a064ec19.tar.bz2
[PECOFF] Add a test for the resource file.
llvm-svn: 193982
-rw-r--r--lld/test/lit.cfg6
-rw-r--r--lld/test/pecoff/Inputs/resource.rc4
-rwxr-xr-xlld/test/pecoff/Inputs/resource.resbin0 -> 108 bytes
-rw-r--r--lld/test/pecoff/resource.test9
4 files changed, 19 insertions, 0 deletions
diff --git a/lld/test/lit.cfg b/lld/test/lit.cfg
index 09a320f..e06dcf7 100644
--- a/lld/test/lit.cfg
+++ b/lld/test/lit.cfg
@@ -134,3 +134,9 @@ if re.search(r'DEBUG', llc_cmd.stdout.read()):
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')
diff --git a/lld/test/pecoff/Inputs/resource.rc b/lld/test/pecoff/Inputs/resource.rc
new file mode 100644
index 0000000..df933e83
--- /dev/null
+++ b/lld/test/pecoff/Inputs/resource.rc
@@ -0,0 +1,4 @@
+STRINGTABLE
+{
+ 1, "Hello"
+}
diff --git a/lld/test/pecoff/Inputs/resource.res b/lld/test/pecoff/Inputs/resource.res
new file mode 100755
index 0000000..f1c799f
--- /dev/null
+++ b/lld/test/pecoff/Inputs/resource.res
Binary files differ
diff --git a/lld/test/pecoff/resource.test b/lld/test/pecoff/resource.test
new file mode 100644
index 0000000..0e73282
--- /dev/null
+++ b/lld/test/pecoff/resource.test
@@ -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'