Add tests for `compile_static` and `compile_static_lazy`