This reverts commit 84a214856ad989f37af19f5e8aaa9ec2346dde6f. This gives us more time to work out the alternative and also people to migrate
26 lines
711 B
Python
26 lines
711 B
Python
# RUN: %python %s pybind11 | FileCheck %s
|
|
# RUN: %python %s nanobind | FileCheck %s
|
|
|
|
import sys
|
|
from mlir_standalone.ir import *
|
|
|
|
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()
|
|
module = Module.parse(
|
|
"""
|
|
%0 = arith.constant 2 : i32
|
|
%1 = standalone.foo %0 : i32
|
|
"""
|
|
)
|
|
# CHECK: %[[C:.*]] = arith.constant 2 : i32
|
|
# CHECK: standalone.foo %[[C]] : i32
|
|
print(str(module))
|