[Plugins] Remove CGTestPlugin and add it back as Ciao in examples (#242038)
CGTestPlugin used to test the insertion of passes into the legacy
codegen pipeline via RegisterTargetPassConfigCallback. A LIT test was
running it through llc for the native target and a unit-test checked
that the insertion worked across targets. The unit-test name was
CGPluginTest. This didn't match the filter in LIT, which requires the
names to end in "Tests". I think it never actually ran in CI.
CGTestPlugin predates the time when we enabled examples by default and
was one of the plugins that lived under unittests. In contrast to TestPlugin
and DoublerPlugin, however, it didn't check internal properties of the plugin
interface.
This PR moves the plugin to examples and makes the lit test the single
place that checks it. Motivation for this is to establish a plugin next
to Bye, that allows to test the behavior of codegen plugins in
isolation. There are 2 use-cases for it currently:
(1) We cannot test the legacy codegen pass registration via
RegisterTargetPassConfigCallback with Bye, because it fires during
static initialization. This is incompatible with Bye's coverage of
static linking of extensions into tools. It would apply the pass
injection unconditionally and fail any related test.
(2) We cannot test forwarding of the PreCodeGenCallback to the new
llvm::runCodeGenPipeline() from Bye, because not all tools that we test
with Bye link RunCodeGen.
With this PR remove the existing CGTestPlugin and keep testing (1).
This will allow us to verify (2) in the next step.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>