We should replace `rustc_codegen_spirv::linker::test` unit tests with compiletest ones.
eddyb opened this issue · 0 comments
The main unique aspect of these tests is they take SPIR-V assembly as an input, not Rust code, e.g.:
rust-gpu/crates/rustc_codegen_spirv/src/linker/test.rs
Lines 185 to 202 in acb05d3
However, we might be able to use module_asm!
to feed SPIR-V assembly into the compilation, and compiletest
does have the ability to introduce dependencies to link against. The main weirdness we might need to deal with is all the definitions from e.g. core
that we don't use, but DCE might be able to clean that up.
(Or we could even use e.g. extern "C"
FFI in Rust code to describe such situations without module_asm!
at all!)
If we can do this transition, we wouldn't have to deal with weird artificial compiler sessions and e.g.: