Skip to content

Commit ae9796b

Browse files
committed
Fix shim_arg_size test for 32-bit machines
1 parent da86c81 commit ae9796b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/compile-fail/shim_arg_size.rs

+6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ extern crate libc;
55
// error-pattern: scalar size mismatch
66
fn main() {
77
extern "C" {
8+
// Use the wrong type(ie. not the pointer width) for the `size`
9+
// argument.
10+
#[cfg(target_pointer_width="64")]
811
fn malloc(size: u32) -> *mut std::ffi::c_void;
12+
13+
#[cfg(target_pointer_width="32")]
14+
fn malloc(size: u16) -> *mut std::ffi::c_void;
915
}
1016

1117
unsafe {

0 commit comments

Comments
 (0)