e8ce9fac85
Added run-make tests to verify that, between a Rust-C FFI boundary in both directions, any MTE tags included in a pointer are preserved for the following pointer types, as well as any information stored using TBI: - int - float - string - function
20 lines
323 B
Rust
20 lines
323 B
Rust
#![crate_type = "cdylib"]
|
|
#![crate_name = "foo"]
|
|
|
|
use std::os::raw::c_float;
|
|
|
|
extern "C" {
|
|
fn bar(ptr: *const c_float);
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn foo(ptr: *mut c_float) {
|
|
assert_eq!((ptr as usize) >> 56, 0x1f);
|
|
|
|
unsafe {
|
|
*ptr = 0.5;
|
|
*ptr.wrapping_add(1) = 0.2;
|
|
bar(ptr);
|
|
}
|
|
}
|