summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 09a320f6e49..e06dcf7f85b 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 00000000000..df933e83b77
--- /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 00000000000..f1c799fbbb0
--- /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 00000000000..0e73282f52c
--- /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'
OpenPOWER on IntegriCloud