mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
16 lines
266 B
Rust
16 lines
266 B
Rust
// run-pass
|
|
// ignore-wasm32-bare no libc to test ffi with
|
|
|
|
#[link(name = "rust_test_helpers", kind = "static")]
|
|
extern "C" {
|
|
fn rust_int8_to_int32(_: i8) -> i32;
|
|
}
|
|
|
|
fn main() {
|
|
let x = unsafe {
|
|
rust_int8_to_int32(-1)
|
|
};
|
|
|
|
assert!(x == -1);
|
|
}
|