<div dir="ltr">Hi Tim,<div><br></div><div>I have implemented this engine only for opcodes that are not using memory (it is only for register to register) and currently I have lowered down LLVM IR for mov and add opcode, and thus I need to test this code only.</div><div><br></div><div>Is there any other way to test the same?</div><div><br></div><div>Thanks,</div><div>Sandeep</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 18, 2014 at 9:03 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> This is generated with my are written. Now, I want to test this generated,<br>
> lowered x64bit IR for x86bit machine.<br>
<br>
</span>It looks very different from the 64-bit input, but that's a problem<br>
for debugging to resolve I suppose.<br>
<span class=""><br>
> Please let me know how I can test this. How I can test generated LLVM IR,<br>
> how I can debug this generated LLVM IR.<br>
<br>
</span>If it was me, I'd start with functions with well-defined inputs and<br>
outputs (e.g. "int foo(int a, int b) { return a + b; }"). Create a<br>
test-harness that calls out to this function and then replace the<br>
default implementation with one that comes from your specially<br>
converted IR. Use that to make sure the values match up.<br>
<br>
You'd likely have difficulties with mismatched calling conventions, so<br>
it might be better to use global variables for all input/output (so<br>
"int a, b, res; void foo() { res = a + b; }" instead). They tend to be<br>
easier to get working.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><br>Thanks and Regards,<br>Sandeep Kumar Singh</div>
</div>