Testing MCJIT (vs. standard JIT)

source/Expression/ClangExpressionParser.cpp currently has

#if defined(__FreeBSD__)
#define USE_STANDARD_JIT
#endif

which then includes llvm/ExecutionEngine/JIT.h instead of
llvm/ExecutionEngine/MCJIT.h.

It looks like this has evolved over time from being the default on all
platforms, to !defined(__APPLE__), to the current FreeBSD-only case.
I'm currently tracking down a number of unit test failures on FreeBSD,
but the results seem consistent with or without the USE_STANDARD_JIT
define.

I'd like to enable MCJIT on FreeBSD so that any testing is with the
most commonly used code. Is there a simple case I can use to confirm
that MCJIT works as expected, or known dependencies to investigate?

-Ed

source/Expression/ClangExpressionParser.cpp currently has

#if defined(__FreeBSD__)
#define USE_STANDARD_JIT
#endif

which then includes llvm/ExecutionEngine/JIT.h instead of
llvm/ExecutionEngine/MCJIT.h.

It looks like this has evolved over time from being the default on all
platforms, to !defined(__APPLE__), to the current FreeBSD-only case.
I'm currently tracking down a number of unit test failures on FreeBSD,
but the results seem consistent with or without the USE_STANDARD_JIT
define.

Yes, we should probably switch to using MCJIT for all platforms by default.

I'd like to enable MCJIT on FreeBSD so that any testing is with the
most commonly used code. Is there a simple case I can use to confirm
that MCJIT works as expected, or known dependencies to investigate?

Just launch a program and try to run:

(lldb) expr (void *)malloc(123)

This will tell you if simple things are working.

Thanks. Without MCJIT I get:

(lldb) expr (void *)malloc(123)
error: Expression can't be run, because there is no JIT compiled function

and it works with MCJIT enabled:

(lldb) expr (void *)malloc(123)
(void *) $0 = 0x0000000801007080

so I'll remove the FreeBSD-specific #ifdef case.