Fix MLIR Toy tutorial JIT example and add a test to cover it

This commit is contained in:
Mehdi Amini 2021-02-19 01:53:14 +00:00
parent 9f4f6ac94b
commit ae15b1e7ad
4 changed files with 12 additions and 2 deletions

View File

@ -240,7 +240,7 @@ int runJit(mlir::ModuleOp module) {
auto &engine = maybeEngine.get(); auto &engine = maybeEngine.get();
// Invoke the JIT-compiled function. // Invoke the JIT-compiled function.
auto invocationResult = engine->invoke("main"); auto invocationResult = engine->invokePacked("main");
if (invocationResult) { if (invocationResult) {
llvm::errs() << "JIT invocation failed\n"; llvm::errs() << "JIT invocation failed\n";
return -1; return -1;

View File

@ -241,7 +241,7 @@ int runJit(mlir::ModuleOp module) {
auto &engine = maybeEngine.get(); auto &engine = maybeEngine.get();
// Invoke the JIT-compiled function. // Invoke the JIT-compiled function.
auto invocationResult = engine->invoke("main"); auto invocationResult = engine->invokePacked("main");
if (invocationResult) { if (invocationResult) {
llvm::errs() << "JIT invocation failed\n"; llvm::errs() << "JIT invocation failed\n";
return -1; return -1;

View File

@ -0,0 +1,5 @@
# RUN: toyc-ch6 -emit=jit %s
def main() {
print([[1, 2], [3, 4]]);
}

View File

@ -0,0 +1,5 @@
# RUN: toyc-ch7 -emit=jit %s
def main() {
print([[1, 2], [3, 4]]);
}