2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2018-08-31 15:51:35 +02:00
|
|
|
#![allow(improper_ctypes)]
|
2012-10-10 22:40:17 +02:00
|
|
|
// Issue #3656
|
|
|
|
|
// Incorrect struct size computation in the FFI, because of not taking
|
|
|
|
|
// the alignment of elements into account.
|
|
|
|
|
|
2015-03-05 18:33:58 -08:00
|
|
|
|
2024-04-14 16:23:07 -04:00
|
|
|
use std::ffi::{c_uint, c_void};
|
2012-10-10 22:40:17 +02:00
|
|
|
|
2014-09-19 12:30:07 -07:00
|
|
|
pub struct KEYGEN {
|
2014-12-20 15:20:51 +13:00
|
|
|
hash_algorithm: [c_uint; 2],
|
2019-06-01 15:37:54 +02:00
|
|
|
count: u32,
|
2014-06-25 12:47:34 -07:00
|
|
|
salt: *const c_void,
|
2019-06-01 15:37:54 +02:00
|
|
|
salt_size: u32,
|
2012-10-10 22:40:17 +02:00
|
|
|
}
|
|
|
|
|
|
2020-09-01 17:12:52 -04:00
|
|
|
extern "C" {
|
2012-10-10 22:40:17 +02:00
|
|
|
// Bogus signature, just need to test if it compiles.
|
2013-05-07 21:33:31 -07:00
|
|
|
pub fn malloc(data: KEYGEN);
|
2012-10-10 22:40:17 +02:00
|
|
|
}
|
|
|
|
|
|
2020-09-01 17:12:52 -04:00
|
|
|
pub fn main() {}
|