<div dir="ltr">I think this is the best mailing list for your question, but as for a mailing list dedicated to swift-corelibs-xctest: <a href="mailto:swift-corelibs-dev@swift.org">swift-corelibs-dev@swift.org</a> is for corelibs-libdispatch, corelibs-foundation, and corelibs-xctest.<div><br></div><div>- Brian Gesiak</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 6, 2017 at 12:33 PM, Alex Denisov via swift-dev <span dir="ltr">&lt;<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there,<br>
<br>
I could not find a list for swift-corelibs-xctest so I am posting it here.<br>
<br>
I am trying to run tests based on XCTest (<a href="https://github.com/apple/swift-corelibs-xctest" rel="noreferrer" target="_blank">https://github.com/apple/<wbr>swift-corelibs-xctest</a>) using LLVM&#39;s JIT.<br>
Everything is working good so far. However, I am getting a crash.<br>
Based on a shallow investigation I can see that this is somehow related to the way Swift treats the command line arguments. Or, to be more precise, to the way I pass the arguments to the swift&#39;s &#39;main&#39; function.<br>
<br>
What I did so far is not different from what I do to run C or C++ using JIT:<br>
<br>
auto main = ((int (*)(int, const char **))(intptr_t)mainPointer);<br>
const int argc = 1;<br>
const char *argv[] = { &quot;some-name&quot;, NULL };<br>
auto result = main(argc, argv);<br>
<br>
Based on what I see in the IR[1] the &#39;argv&#39; has type &quot;%Sp = type &lt;{ i8* }&gt;&quot;, which seems to be a struct with a pointer to something.<br>
<br>
So the question is: what is being passed as a second argument to the &#39;main&#39; function of a swift program?<br>
<br>
Any other advice on JIT-ting Swift are more than welcome :)<br>
<br>
[1] <a href="https://gist.github.com/AlexDenisov/3c10540b544e82cfb6e58e1452491904" rel="noreferrer" target="_blank">https://gist.github.com/<wbr>AlexDenisov/<wbr>3c10540b544e82cfb6e58e14524919<wbr>04</a><br>
<span class="HOEnZb"><font color="#888888">--<br>
AlexDenisov<br>
Software Engineer, <a href="https://lowlevelbits.org" rel="noreferrer" target="_blank">https://lowlevelbits.org</a><br>
<br>
______________________________<wbr>_________________<br>
swift-dev mailing list<br>
<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</a><br>
</font></span></blockquote></div><br></div>