File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ // RUN: mlir-opt %s --test-bytecode-roundtrip=test-dialect-version=2.0 | FileCheck %s
2+
3+ // CHECK-LABEL: func.func @main
4+ func.func @main () {
5+ return
6+ }
Original file line number Diff line number Diff line change @@ -141,8 +141,8 @@ struct TestBytecodeRoundtripPass
141141 DialectBytecodeWriter &writer) -> LogicalResult {
142142 // Do not override anything if version greater than 2.0.
143143 auto versionOr = writer.getDialectVersion <test::TestDialect>();
144- assert ( succeeded (versionOr) && " expected reader to be able to access "
145- " the version for test dialect " );
144+ if ( failed (versionOr))
145+ return failure ( );
146146 const auto *version =
147147 reinterpret_cast <const test::TestDialectVersion *>(*versionOr);
148148 if (version->major_ >= 2 )
@@ -166,8 +166,8 @@ struct TestBytecodeRoundtripPass
166166 Type &entry) -> LogicalResult {
167167 // Get test dialect version from the version map.
168168 auto versionOr = reader.getDialectVersion <test::TestDialect>();
169- assert ( succeeded (versionOr) && " expected reader to be able to access "
170- " the version for test dialect " );
169+ if ( failed (versionOr))
170+ return success ( );
171171 const auto *version =
172172 reinterpret_cast <const test::TestDialectVersion *>(*versionOr);
173173 if (version->major_ >= 2 )
You can’t perform that action at this time.
0 commit comments