[OpenACC] Implement 'collapse' for combined constructs.
[llvm-project.git] / compiler-rt / lib / orc / tests / tools / orc-rt-executor.cpp
blobda45a2d64d687462fb7922fe2a90a5450eb42656
1 //===- orc-rt-executor.cpp ------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
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
11 // llvm-jitlink.
13 //===----------------------------------------------------------------------===//
15 #include <cstring>
16 #include <iostream>
17 #include <optional>
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"
26 << "\n"
27 << " Notes:\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[]) {
35 if (argc < 2) {
36 printHelp("orc-rt-executor", std::cerr);
37 std::cerr << "error: insufficient arguments.\n";
38 exit(1);
41 if (!strcmp(argv[1], "help")) {
42 printHelp(argv[0], std::cerr);
43 exit(0);
46 std::cerr << "error: One day I will be a real program, but I am not yet.\n";
48 return 0;