This is primarily for testing libMLIR.so
I've gone back and forth. I think it's weird for the 'regular' mlir-opt to include the test dialect. I was thinking that the test dialect should run with a test-mlir-opt
which includes the test dialect in addition to all the normal dialects. (or maybe *only* the test dialect?)
Out of curiosity, no need to call define and registerTestPasses()? Further, calling registerAllDialects() and registerAllPasses() can be skipped? Is that due linking against libMLIR.so?
No, this is just a little old. Currently, calling registerAllDialects() and registerAllPasses() is required if you want any of the standard stuff. The .cpp code was just a copy of what's in tools/mlir-opt. The critical part of this is the CMakeLists.txt, which was intended as a test for linking against libMLIR.so. If you actually want to build an external project see: https://reviews.llvm.org/D76047