MCPcopy Create free account
hub / github.com/aguinet/dragonffi / main

Function main

tests/array.cpp:22–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20using namespace dffi;
21
22int main(int argc, char** argv)
23{
24 DFFI::initialize();
25
26 CCOpts Opts;
27 Opts.OptLevel = 2;
28
29 DFFI Jit(Opts);
30
31 std::string Err;
32 auto CU = Jit.compile(R"(
33struct A
34{
35 char buf[256];
36};
37struct A init() {
38 struct A ret;
39 strcpy(&ret.buf[0], "hello!");
40 return ret;
41}
42void print(struct A* a) {
43 puts(a->buf);
44}
45)", Err);
46 if (!CU) {
47 std::cerr << Err << std::endl;
48 return 1;
49 }
50
51 return 0;
52}

Callers

nothing calls this directly

Calls 1

compileMethod · 0.45

Tested by

no test coverage detected