Skip to content

Commit f8c1f3b

Browse files
committed
Revert "Revert "Fix MLIR Toy tutorial JIT example and add a test to cover it""
This reverts commit f360604 and reapply commit ae15b1e. JIT test must be annotated to not run on Windows.
1 parent b006f55 commit f8c1f3b

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

mlir/examples/toy/Ch6/toyc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ int runJit(mlir::ModuleOp module) {
240240
auto &engine = maybeEngine.get();
241241

242242
// Invoke the JIT-compiled function.
243-
auto invocationResult = engine->invoke("main");
243+
auto invocationResult = engine->invokePacked("main");
244244
if (invocationResult) {
245245
llvm::errs() << "JIT invocation failed\n";
246246
return -1;

mlir/examples/toy/Ch7/toyc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ int runJit(mlir::ModuleOp module) {
241241
auto &engine = maybeEngine.get();
242242

243243
// Invoke the JIT-compiled function.
244-
auto invocationResult = engine->invoke("main");
244+
auto invocationResult = engine->invokePacked("main");
245245
if (invocationResult) {
246246
llvm::errs() << "JIT invocation failed\n";
247247
return -1;

mlir/test/Examples/Toy/Ch6/jit.toy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# RUN: toyc-ch6 -emit=jit %s
2+
# UNSUPPORTED: windows
3+
4+
def main() {
5+
print([[1, 2], [3, 4]]);
6+
}

mlir/test/Examples/Toy/Ch7/jit.toy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# RUN: toyc-ch7 -emit=jit %s
2+
# UNSUPPORTED: windows
3+
4+
def main() {
5+
print([[1, 2], [3, 4]]);
6+
}

0 commit comments

Comments
 (0)