diff options
-rw-r--r-- | lld/test/lit.cfg | 6 | ||||
-rw-r--r-- | lld/test/pecoff/Inputs/resource.rc | 4 | ||||
-rwxr-xr-x | lld/test/pecoff/Inputs/resource.res | bin | 0 -> 108 bytes | |||
-rw-r--r-- | lld/test/pecoff/resource.test | 9 |
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 Binary files differnew file mode 100755 index 00000000000..f1c799fbbb0 --- /dev/null +++ b/lld/test/pecoff/Inputs/resource.res 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' |