summaryrefslogtreecommitdiff
path: root/tests/expectations/tests/layout_array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/expectations/tests/layout_array.rs')
-rw-r--r--tests/expectations/tests/layout_array.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/expectations/tests/layout_array.rs b/tests/expectations/tests/layout_array.rs
index 2fd93c4a..0da08871 100644
--- a/tests/expectations/tests/layout_array.rs
+++ b/tests/expectations/tests/layout_array.rs
@@ -49,6 +49,7 @@ pub type rte_mempool_get_count =
::std::option::Option<unsafe extern "C" fn(mp: *const rte_mempool) -> ::std::os::raw::c_uint>;
/// Structure defining mempool operations structure
#[repr(C)]
+#[repr(align(64))]
#[derive(Copy, Clone)]
pub struct rte_mempool_ops {
///< Name of mempool ops struct.
@@ -73,6 +74,11 @@ fn bindgen_test_layout_rte_mempool_ops() {
concat!("Size of: ", stringify!(rte_mempool_ops))
);
assert_eq!(
+ ::std::mem::align_of::<rte_mempool_ops>(),
+ 64usize,
+ concat!("Alignment of ", stringify!(rte_mempool_ops))
+ );
+ assert_eq!(
unsafe { &(*(::std::ptr::null::<rte_mempool_ops>())).name as *const _ as usize },
0usize,
concat!(
@@ -186,6 +192,7 @@ fn bindgen_test_layout_rte_spinlock_t() {
/// any function pointers stored directly in the mempool struct would not be.
/// This results in us simply having "ops_index" in the mempool struct.
#[repr(C)]
+#[repr(align(64))]
#[derive(Copy, Clone)]
pub struct rte_mempool_ops_table {
///< Spinlock for add/delete.
@@ -204,6 +211,11 @@ fn bindgen_test_layout_rte_mempool_ops_table() {
concat!("Size of: ", stringify!(rte_mempool_ops_table))
);
assert_eq!(
+ ::std::mem::align_of::<rte_mempool_ops_table>(),
+ 64usize,
+ concat!("Alignment of ", stringify!(rte_mempool_ops_table))
+ );
+ assert_eq!(
unsafe { &(*(::std::ptr::null::<rte_mempool_ops_table>())).sl as *const _ as usize },
0usize,
concat!(
@@ -241,6 +253,7 @@ impl Default for rte_mempool_ops_table {
}
/// Structure to hold malloc heap
#[repr(C)]
+#[repr(align(64))]
#[derive(Copy, Clone)]
pub struct malloc_heap {
pub lock: rte_spinlock_t,
@@ -291,6 +304,11 @@ fn bindgen_test_layout_malloc_heap() {
concat!("Size of: ", stringify!(malloc_heap))
);
assert_eq!(
+ ::std::mem::align_of::<malloc_heap>(),
+ 64usize,
+ concat!("Alignment of ", stringify!(malloc_heap))
+ );
+ assert_eq!(
unsafe { &(*(::std::ptr::null::<malloc_heap>())).lock as *const _ as usize },
0usize,
concat!(