aboutsummaryrefslogtreecommitdiff
path: root/mlir/examples/standalone/test/python/smoketest.py
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/examples/standalone/test/python/smoketest.py')
-rw-r--r--mlir/examples/standalone/test/python/smoketest.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/mlir/examples/standalone/test/python/smoketest.py b/mlir/examples/standalone/test/python/smoketest.py
index f881984..26d84fd 100644
--- a/mlir/examples/standalone/test/python/smoketest.py
+++ b/mlir/examples/standalone/test/python/smoketest.py
@@ -1,7 +1,16 @@
+# RUN: %python %s pybind11 | FileCheck %s
# RUN: %python %s nanobind | FileCheck %s
+import sys
from mlir_standalone.ir import *
-from mlir_standalone.dialects import standalone_nanobind as standalone_d
+
+if sys.argv[1] == "pybind11":
+ from mlir_standalone.dialects import standalone_pybind11 as standalone_d
+elif sys.argv[1] == "nanobind":
+ from mlir_standalone.dialects import standalone_nanobind as standalone_d
+else:
+ raise ValueError("Expected either pybind11 or nanobind as arguments")
+
with Context():
standalone_d.register_dialects()