summaryrefslogtreecommitdiffstats
path: root/tests/run-make/wasm-symbols-different-module/baz.rs
blob: fbb78619bb8f526b2172b2ab26e74f8e05ec66ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! Issue #63562

#![crate_type = "cdylib"]

mod foo {
    #[link(wasm_import_module = "sqlite")]
    extern "C" {
        pub fn allocate(size: usize) -> i32;
        pub fn deallocate(ptr: i32, size: usize);
    }
}

#[no_mangle]
pub extern "C" fn allocate() {
    unsafe {
        foo::allocate(1);
        foo::deallocate(1, 2);
    }
}

#[no_mangle]
pub extern "C" fn deallocate() {}