<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 2, 2014 at 6:27 PM, Nick Kledzik <span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">For lld to mimic the darwin linker it needs to support an option that dumps a binary file which contains a list of the input and output files. This file is used by Xcode to dynamically update its dependency graph.<br>
<br>
I’m a bit stumped on how to test this. Some ideas I have:<br>
<br>
* Use REQUIRES: shell, then run hexdump and FileCheck that (is hexdump output consistent on all *nix platforms?)<br></blockquote><div><br></div><div>I doubt that hexdump output is consistent across all Unix systems.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
* Use REQUIRES: shell, then run sed or perl to format the file with lines and opcode values and FileCheck that (is sed/perl on all platforms?)<br>
<br>
* Since lit uses Python, it seems like I should be able to use python to transform the file into something FileCheck can process.  But I don’t know how to invoke python from a RUN: line in a cross platform way.<br></blockquote><div><br></div><div>I don't see any reason to use Perl, because it may not be available on some platforms, and Perl and Python are mostly functionally equivalent.</div><div><br></div><div>I'd do with Python. I'd write a binary-to-text converter as a Python script, put it into test/ directory, and then let lit to run the script by appending a magic comment to the script like this:<br></div><div><br></div><div>  # RUN: lld -flavor darwin -output %t.binary ...  </div><div>  # python %s %t.binary | FileCheck %s</div><div>  #</div><div>  # CHECK: <expected text output here></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
* Add a C tool to llvm that dumps out a dependency file in a human and FileCheck readable way.  Seems like overkill to add a directory to llvm/tools/ that contains a tool only useful for dumping a Xcode file.  Comparing the file bytes is all I really need.<br>
<br>
* Write an llvm-hexdump tool in llvm/tools/ and use that in my test case.<br>
<br>
Thoughts?<br>
<br>
-Nick<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div></div>