<div dir="ltr">The RuntimeDyld layer doesn't have great testing infrastructure yet. I could write an MCJIT test that produced the right relocation on x86-64, but that doesn't really help much: It would run on all testers, but only test the desired behavior on x86-64. Moreover if there were any changes to CodeGen, MCJIT might end producing different relocations and so quietly cease testing what we wanted.<div>
<br><div><div>The ideal way to test this would be to teach llvm-rtdyld how to dump the relocated sections. Then we'd need a utility to hoover up the interesting bytes (representing GOT entries) from a byte stream, reconstruct addresses, then run some expressions on them to verify that things are laid out as expected. That would be awesome, but it would (will?) also take some work.</div>
<div><br></div><div>Despite the lack of tests, this change should stay in tree: the previous behavior was wrong, and reverting to known broken behavior isn't the answer to missing tests.</div></div></div><div><br></div>
<div>- Lang.</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 19, 2014 at 12:51 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Mon, May 19, 2014 at 12:38 PM, Lang Hames <<a href="mailto:lhames@gmail.com">lhames@gmail.com</a>> wrote:<br>

> Author: lhames<br>
> Date: Mon May 19 14:38:48 2014<br>
> New Revision: 209155<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=209155&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=209155&view=rev</a><br>
> Log:<br>
> Fix testers by removing dubious testcase for r209154.<br>
><br>
> It turns out that not all the world is x86-64. Who knew?<br>
><br>
> I'll get to work on a more appropriate test case for this patch.<br>
<br>
</div>Reverting/removing test cases while leaving functionality untested<br>
in-tree isn't usually ideal.<br>
<br>
I /think/ we usually just revert the whole patch, fix the tests, then<br>
recommit. (also makes it a bit easier to understand when spelunking<br>
back through the history later - the test goes with the code that it<br>
verifies)<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> Removed:<br>
>     llvm/trunk/test/ExecutionEngine/RuntimeDyld/Inputs/x86_64_macho_pic_globals_GOT.o<br>
> Modified:<br>
>     llvm/trunk/test/ExecutionEngine/RuntimeDyld/macho_relocations.test<br>
><br>
> Removed: llvm/trunk/test/ExecutionEngine/RuntimeDyld/Inputs/x86_64_macho_pic_globals_GOT.o<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/Inputs/x86_64_macho_pic_globals_GOT.o?rev=209154&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/Inputs/x86_64_macho_pic_globals_GOT.o?rev=209154&view=auto</a><br>

> ==============================================================================<br>
> Binary file - no diff available.<br>
><br>
> Modified: llvm/trunk/test/ExecutionEngine/RuntimeDyld/macho_relocations.test<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/macho_relocations.test?rev=209155&r1=209154&r2=209155&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/macho_relocations.test?rev=209155&r1=209154&r2=209155&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/test/ExecutionEngine/RuntimeDyld/macho_relocations.test (original)<br>
> +++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/macho_relocations.test Mon May 19 14:38:48 2014<br>
> @@ -1,2 +1 @@<br>
>  RUN: llvm-rtdyld -printline %p/Inputs/arm_secdiff_reloc.o<br>
> -RUN: llvm-rtdyld %p/Inputs/x86_64_macho_pic_globals_GOT.o<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">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>
</div></div></blockquote></div><br></div>