[swift-dev] JIT-ting Swift

Brian Gesiak modocache at gmail.com
Mon Mar 6 12:26:51 CST 2017


I think this is the best mailing list for your question, but as for a
mailing list dedicated to swift-corelibs-xctest:
swift-corelibs-dev at swift.org is for corelibs-libdispatch,
corelibs-foundation, and corelibs-xctest.

- Brian Gesiak


On Mon, Mar 6, 2017 at 12:33 PM, Alex Denisov via swift-dev <
swift-dev at swift.org> wrote:

> Hi there,
>
> I could not find a list for swift-corelibs-xctest so I am posting it here.
>
> I am trying to run tests based on XCTest (https://github.com/apple/
> swift-corelibs-xctest) using LLVM's JIT.
> Everything is working good so far. However, I am getting a crash.
> 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's 'main' function.
>
> What I did so far is not different from what I do to run C or C++ using
> JIT:
>
> auto main = ((int (*)(int, const char **))(intptr_t)mainPointer);
> const int argc = 1;
> const char *argv[] = { "some-name", NULL };
> auto result = main(argc, argv);
>
> Based on what I see in the IR[1] the 'argv' has type "%Sp = type <{ i8*
> }>", which seems to be a struct with a pointer to something.
>
> So the question is: what is being passed as a second argument to the
> 'main' function of a swift program?
>
> Any other advice on JIT-ting Swift are more than welcome :)
>
> [1] https://gist.github.com/AlexDenisov/3c10540b544e82cfb6e58e1452491904
> --
> AlexDenisov
> Software Engineer, https://lowlevelbits.org
>
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170306/38ffc0b7/attachment.html>


More information about the swift-dev mailing list