llvm-project/mlir/test/Bytecode/bytecode_callback_full_override.mlir
Matteo Franciolini 7ad9e9dcf5
[mlir][bytecode] Implements back deployment capability for MLIR dialects (#70724)
When emitting bytecode, clients can specify a target dialect version to
emit in `BytecodeWriterConfig`. This exposes a target dialect version to
the DialectBytecodeWriter, which can be queried by name and used to
back-deploy attributes, types, and properties.
2023-10-31 15:41:29 -07:00

19 lines
574 B
MLIR

// RUN: not mlir-opt %s -split-input-file --test-bytecode-roundtrip="test-kind=5" 2>&1 | FileCheck %s
// CHECK-NOT: failed to read bytecode
func.func @base_test(%arg0 : i32) -> f32 {
%0 = "test.addi"(%arg0, %arg0) : (i32, i32) -> i32
%1 = "test.cast"(%0) : (i32) -> f32
return %1 : f32
}
// -----
// CHECK-LABEL: error: unknown attribute code: 99
// CHECK: failed to read bytecode
func.func @base_test(%arg0 : !test.i32) -> f32 {
%0 = "test.addi"(%arg0, %arg0) : (!test.i32, !test.i32) -> !test.i32
%1 = "test.cast"(%0) : (!test.i32) -> f32
return %1 : f32
}