1 //===- orc-rt-executor.cpp ------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Contains the orc-rt-executor test tool. This is a "blank executable" that
10 // links the ORC runtime and can accept code from a JIT controller like lii or
13 //===----------------------------------------------------------------------===//
18 #include <string_view>
20 void printHelp(std::string_view ProgName
, std::ostream
&OS
) {
21 OS
<< "usage: " << ProgName
<< " [help] [<mode>] <program arguments>...\n"
22 << " <mode> -- specify how to listen for JIT'd program\n"
23 << " filedesc=<in>,<out> -- read from <in> filedesc, write to out\n"
24 << " tcp=<host>:<port> -- listen on the given host/port\n"
25 << " help -- print help and exit\n"
28 << " Program arguments will be made available to the JIT controller.\n"
29 << " When running a JIT'd program containing a main function the\n"
30 << " controller may choose to pass these on to main, however\n"
31 << " orc-rt-executor does not enforce this.\n";
34 int main(int argc
, char *argv
[]) {
36 printHelp("orc-rt-executor", std::cerr
);
37 std::cerr
<< "error: insufficient arguments.\n";
41 if (!strcmp(argv
[1], "help")) {
42 printHelp(argv
[0], std::cerr
);
46 std::cerr
<< "error: One day I will be a real program, but I am not yet.\n";