diff --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp --- a/mlir/tools/mlir-opt/mlir-opt.cpp +++ b/mlir/tools/mlir-opt/mlir-opt.cpp @@ -133,7 +133,9 @@ #endif DialectRegistry registry; registerAllDialects(registry); +#ifdef MLIR_INCLUDE_TESTS registerTestDialect(registry); +#endif return failed(MlirOptMain(argc, argv, "MLIR modular optimizer driver\n", registry, /*preloadDialectsInContext=*/false));