Is there anything similar to `AbstractFirBlackBoxC...
# compiler
r
Is there anything similar to
AbstractFirBlackBoxCodegenTestBase
for native targets? I would like to create some tests for native codegen logic, but it seems all blackbox codegen tests are JVM based.
It looks like
AbstractNativeCodegenBoxTest
is used for native, but that isn’t part of the test infrastructure 😅
d
Native tests indeed use different test infrastructure, which is not published And even if it was, I'm not sure that those tests will work outside of Kotlin repo, unfortunately You can create a request in YouTrack for this
but it seems all blackbox codegen tests are JVM based
JS and WASM test use the same infrastructure as JVM, but the implementation is located in the js.tests, which is also not published
r
Thanks. Would there be any obvious problems/downsides to using JVM based tests for native codegen logic? I mean both use FIR and IR, not sure how much the target will affect the accuracy of the tests.
d
I see the following obstacles on this way: • proper setup of native backend in the facade after fir2ir is over • implementation of llvm facade for different platforms (as native backend produces llvm bitcode, not native code directly)
Also I have no idea how to properly implement box runner for native binaries
r
Alright thanks. I’ll have a look at
AbstractFirBlackBoxCodegenTestBase
and see how far I can get with that 🤞🏻. Most of the codegen logic should be platform agnostic anyways.
d
The logic itself -- yes. But the entrypoint is different I even don't know in what exact place the native backend entrypoint is located
r
I see. I was thinking of just ignoring the whole native target. “pretending” that the compiler plugin normally runs for JVM instead of native. Not really the same, but I am basically only interested in the FIR and IR dump.
I also have some integrations tests in a sample project. So that should test the complete setup for native targets. I am mostly looking for an easy way to test and debug the FIR and IR logic of the plugin