Fix usage of default_libcall_names (#2378)

* Fix usage of default_libcall_names

* Add basic cranelift-object test

It is based on a test with the same name in cranelift-simplejit
This commit is contained in:
bjorn3
2020-11-09 17:33:56 +01:00
committed by GitHub
parent c9e8889d47
commit 5df5bbbdca
5 changed files with 209 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");
/// Default names for `ir::LibCall`s. A function by this name is imported into the object as
/// part of the translation of a `ir::ExternalName::LibCall` variant.
pub fn default_libcall_names() -> Box<dyn Fn(ir::LibCall) -> String> {
pub fn default_libcall_names() -> Box<dyn Fn(ir::LibCall) -> String + Send + Sync> {
Box::new(move |libcall| match libcall {
ir::LibCall::Probestack => "__cranelift_probestack".to_owned(),
ir::LibCall::UdivI64 => "__udivdi3".to_owned(),