<div dir="ltr">On Mon, Nov 4, 2013 at 9:20 AM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im"><span style="font-size:13px;font-family:arial,sans-serif">+# Check if the binary contains UTF-16 string "Hello" copied from resource.res.</span><br style="font-size:13px;font-family:arial,sans-serif">


<span style="font-size:13px;font-family:arial,sans-serif">+# cat %t.exe | grep 'H.e.l.l.o'</span><br><div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div>
</div><div><span style="font-size:13px;font-family:arial,sans-serif">I would specifically say UTF-16LE, since this code assumes that.</span></div><div><span style="font-size:13px;font-family:arial,sans-serif"><br>
</span></div><div><span style="font-size:13px;font-family:arial,sans-serif">Also, we're trying to get away from using grep in the test suite (yes, there are still a lot of uses). That will, among other things, make it easier to extend this test later (or is this all the resource file functionality we intend to implement?).</span></div>

</div></blockquote><div><br></div><div>No, the implementation of the resource file functionality is still incomplete -- actually it's wrong. The resource data should have been emitted to .rsrc section, however it's currently emitted to .rdata. Once the issue is fixed, I'll rewrite this test with llvm-objdump -s and FileCheck utility, removing the dependency to grep.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="HOEnZb"><font color="#888888"><div><span style="font-size:13px;font-family:arial,sans-serif">-- Sean Silva</span></div>

</font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Nov 4, 2013 at 12:17 AM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Author: ruiu<br>
Date: Sun Nov  3 23:17:54 2013<br>
New Revision: 193982<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=193982&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=193982&view=rev</a><br>
Log:<br>
[PECOFF] Add a test for the resource file.<br>
<br>
Added:<br>
    lld/trunk/test/pecoff/Inputs/resource.rc<br>
    lld/trunk/test/pecoff/Inputs/resource.res   (with props)<br>
    lld/trunk/test/pecoff/resource.test<br>
Modified:<br>
    lld/trunk/test/lit.cfg<br>
<br>
Modified: lld/trunk/test/lit.cfg<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg?rev=193982&r1=193981&r2=193982&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg?rev=193982&r1=193981&r2=193982&view=diff</a><br>



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



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



==============================================================================<br>
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<br>
<br>
Propchange: lld/trunk/test/pecoff/Inputs/resource.res<br>
------------------------------------------------------------------------------<br>
    svn:executable = *<br>
<br>
Added: lld/trunk/test/pecoff/resource.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/resource.test?rev=193982&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/resource.test?rev=193982&view=auto</a><br>



==============================================================================<br>
--- lld/trunk/test/pecoff/resource.test (added)<br>
+++ lld/trunk/test/pecoff/resource.test Sun Nov  3 23:17:54 2013<br>
@@ -0,0 +1,9 @@<br>
+# REQUIRES: winres<br>
+<br>
+# RUN: yaml2obj %p/Inputs/nop.obj.yaml > %t.obj<br>
+#<br>
+# RUN: lld -flavor link /out:%t.exe /subsystem:console /entry:start /opt:noref \<br>
+# RUN:   -- %t.obj %p/Inputs/resource.res<br>
+<br>
+# Check if the binary contains UTF-16 string "Hello" copied from resource.res.<br>
+# cat %t.exe | grep 'H.e.l.l.o'<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div></div></div>