@@ -39,15 +39,22 @@ pub struct C {
39
39
pub mB : B < :: std:: os:: raw:: c_uint > ,
40
40
pub mBConstPtr : B < * const :: std:: os:: raw:: c_int > ,
41
41
pub mBConstStructPtr : B < * const mozilla_Foo > ,
42
+ pub mBConstStructPtrArray : B < [ * const mozilla_Foo ; 1usize ] > ,
42
43
pub mBConst : B < :: std:: os:: raw:: c_int > ,
43
44
pub mBVolatile : B < :: std:: os:: raw:: c_int > ,
44
45
pub mBConstBool : B < bool > ,
45
46
pub mBConstChar : B < u16 > ,
46
47
pub mBArray : B < [ :: std:: os:: raw:: c_int ; 1usize ] > ,
48
+ pub mBPtrArray : B < [ * mut :: std:: os:: raw:: c_int ; 1usize ] > ,
49
+ pub mBArrayPtr : B < * mut [ :: std:: os:: raw:: c_int ; 1usize ] > ,
50
+ pub mBRef : B < * mut :: std:: os:: raw:: c_int > ,
51
+ pub mBConstRef : B < * const :: std:: os:: raw:: c_int > ,
52
+ pub mPtrRef : B < * mut * mut :: std:: os:: raw:: c_int > ,
53
+ pub mArrayRef : B < * mut [ :: std:: os:: raw:: c_int ; 1usize ] > ,
47
54
}
48
55
#[ test]
49
56
fn bindgen_test_layout_C ( ) {
50
- assert_eq ! ( :: std:: mem:: size_of:: <C >( ) , 40usize , concat ! (
57
+ assert_eq ! ( :: std:: mem:: size_of:: <C >( ) , 96usize , concat ! (
51
58
"Size of: " , stringify ! ( C ) ) ) ;
52
59
assert_eq ! ( :: std:: mem:: align_of:: <C >( ) , 8usize , concat ! (
53
60
"Alignment of " , stringify ! ( C ) ) ) ;
@@ -65,31 +72,66 @@ fn bindgen_test_layout_C() {
65
72
usize } , 16usize , concat ! (
66
73
"Alignment of field: " , stringify ! ( C ) , "::" , stringify
67
74
! ( mBConstStructPtr ) ) ) ;
75
+ assert_eq ! ( unsafe {
76
+ & ( * ( 0 as * const C ) ) . mBConstStructPtrArray as * const
77
+ _ as usize } , 24usize , concat ! (
78
+ "Alignment of field: " , stringify ! ( C ) , "::" , stringify
79
+ ! ( mBConstStructPtrArray ) ) ) ;
68
80
assert_eq ! ( unsafe {
69
81
& ( * ( 0 as * const C ) ) . mBConst as * const _ as usize } ,
70
- 24usize , concat ! (
82
+ 32usize , concat ! (
71
83
"Alignment of field: " , stringify ! ( C ) , "::" , stringify
72
84
! ( mBConst ) ) ) ;
73
85
assert_eq ! ( unsafe {
74
86
& ( * ( 0 as * const C ) ) . mBVolatile as * const _ as usize
75
- } , 28usize , concat ! (
87
+ } , 36usize , concat ! (
76
88
"Alignment of field: " , stringify ! ( C ) , "::" , stringify
77
89
! ( mBVolatile ) ) ) ;
78
90
assert_eq ! ( unsafe {
79
91
& ( * ( 0 as * const C ) ) . mBConstBool as * const _ as usize
80
- } , 32usize , concat ! (
92
+ } , 40usize , concat ! (
81
93
"Alignment of field: " , stringify ! ( C ) , "::" , stringify
82
94
! ( mBConstBool ) ) ) ;
83
95
assert_eq ! ( unsafe {
84
96
& ( * ( 0 as * const C ) ) . mBConstChar as * const _ as usize
85
- } , 34usize , concat ! (
97
+ } , 42usize , concat ! (
86
98
"Alignment of field: " , stringify ! ( C ) , "::" , stringify
87
99
! ( mBConstChar ) ) ) ;
88
100
assert_eq ! ( unsafe {
89
101
& ( * ( 0 as * const C ) ) . mBArray as * const _ as usize } ,
90
- 36usize , concat ! (
102
+ 44usize , concat ! (
91
103
"Alignment of field: " , stringify ! ( C ) , "::" , stringify
92
104
! ( mBArray ) ) ) ;
105
+ assert_eq ! ( unsafe {
106
+ & ( * ( 0 as * const C ) ) . mBPtrArray as * const _ as usize
107
+ } , 48usize , concat ! (
108
+ "Alignment of field: " , stringify ! ( C ) , "::" , stringify
109
+ ! ( mBPtrArray ) ) ) ;
110
+ assert_eq ! ( unsafe {
111
+ & ( * ( 0 as * const C ) ) . mBArrayPtr as * const _ as usize
112
+ } , 56usize , concat ! (
113
+ "Alignment of field: " , stringify ! ( C ) , "::" , stringify
114
+ ! ( mBArrayPtr ) ) ) ;
115
+ assert_eq ! ( unsafe {
116
+ & ( * ( 0 as * const C ) ) . mBRef as * const _ as usize } ,
117
+ 64usize , concat ! (
118
+ "Alignment of field: " , stringify ! ( C ) , "::" , stringify
119
+ ! ( mBRef ) ) ) ;
120
+ assert_eq ! ( unsafe {
121
+ & ( * ( 0 as * const C ) ) . mBConstRef as * const _ as usize
122
+ } , 72usize , concat ! (
123
+ "Alignment of field: " , stringify ! ( C ) , "::" , stringify
124
+ ! ( mBConstRef ) ) ) ;
125
+ assert_eq ! ( unsafe {
126
+ & ( * ( 0 as * const C ) ) . mPtrRef as * const _ as usize } ,
127
+ 80usize , concat ! (
128
+ "Alignment of field: " , stringify ! ( C ) , "::" , stringify
129
+ ! ( mPtrRef ) ) ) ;
130
+ assert_eq ! ( unsafe {
131
+ & ( * ( 0 as * const C ) ) . mArrayRef as * const _ as usize }
132
+ , 88usize , concat ! (
133
+ "Alignment of field: " , stringify ! ( C ) , "::" , stringify
134
+ ! ( mArrayRef ) ) ) ;
93
135
}
94
136
impl Clone for C {
95
137
fn clone ( & self ) -> Self { * self }
@@ -353,6 +395,17 @@ fn __bindgen_test_layout_B_open0_ptr_const_mozilla__Foo_close0_instantiation() {
353
395
B <* const mozilla_Foo> ) ) ) ;
354
396
}
355
397
#[ test]
398
+ fn __bindgen_test_layout_B_open0_array1_ptr_const_mozilla__Foo_close0_instantiation ( ) {
399
+ assert_eq ! ( :: std:: mem:: size_of:: <B <[ * const mozilla_Foo; 1usize ] >>( ) ,
400
+ 8usize , concat ! (
401
+ "Size of template specialization: " , stringify ! (
402
+ B <[ * const mozilla_Foo; 1usize ] > ) ) ) ;
403
+ assert_eq ! ( :: std:: mem:: align_of:: <B <[ * const mozilla_Foo; 1usize ] >>( ) ,
404
+ 8usize , concat ! (
405
+ "Alignment of template specialization: " , stringify ! (
406
+ B <[ * const mozilla_Foo; 1usize ] > ) ) ) ;
407
+ }
408
+ #[ test]
356
409
fn __bindgen_test_layout_B_open0_const_int_close0_instantiation ( ) {
357
410
assert_eq ! ( :: std:: mem:: size_of:: <B <:: std:: os:: raw:: c_int>>( ) , 4usize ,
358
411
concat ! (
@@ -393,7 +446,7 @@ fn __bindgen_test_layout_B_open0_const_char16_t_close0_instantiation() {
393
446
) ) ) ;
394
447
}
395
448
#[ test]
396
- fn __bindgen_test_layout_B_open0_array_int_1_close0_instantiation ( ) {
449
+ fn __bindgen_test_layout_B_open0_array1_int_close0_instantiation ( ) {
397
450
assert_eq ! ( :: std:: mem:: size_of:: <B <[ :: std:: os:: raw:: c_int; 1usize ] >>( ) ,
398
451
4usize , concat ! (
399
452
"Size of template specialization: " , stringify ! (
@@ -404,6 +457,72 @@ fn __bindgen_test_layout_B_open0_array_int_1_close0_instantiation() {
404
457
B <[ :: std:: os:: raw:: c_int; 1usize ] > ) ) ) ;
405
458
}
406
459
#[ test]
460
+ fn __bindgen_test_layout_B_open0_array1_ptr_int_close0_instantiation ( ) {
461
+ assert_eq ! ( :: std:: mem:: size_of:: <B <[ * mut :: std:: os:: raw:: c_int; 1usize ] >>( )
462
+ , 8usize , concat ! (
463
+ "Size of template specialization: " , stringify ! (
464
+ B <[ * mut :: std:: os:: raw:: c_int; 1usize ] > ) ) ) ;
465
+ assert_eq ! ( :: std:: mem:: align_of:: <B <[ * mut :: std:: os:: raw:: c_int; 1usize ] >>( )
466
+ , 8usize , concat ! (
467
+ "Alignment of template specialization: " , stringify ! (
468
+ B <[ * mut :: std:: os:: raw:: c_int; 1usize ] > ) ) ) ;
469
+ }
470
+ #[ test]
471
+ fn __bindgen_test_layout_B_open0_ptr_array1_int_close0_instantiation ( ) {
472
+ assert_eq ! ( :: std:: mem:: size_of:: <B <* mut [ :: std:: os:: raw:: c_int; 1usize ] >>( )
473
+ , 8usize , concat ! (
474
+ "Size of template specialization: " , stringify ! (
475
+ B <* mut [ :: std:: os:: raw:: c_int; 1usize ] > ) ) ) ;
476
+ assert_eq ! ( :: std:: mem:: align_of:: <B <* mut [ :: std:: os:: raw:: c_int; 1usize ] >>( )
477
+ , 8usize , concat ! (
478
+ "Alignment of template specialization: " , stringify ! (
479
+ B <* mut [ :: std:: os:: raw:: c_int; 1usize ] > ) ) ) ;
480
+ }
481
+ #[ test]
482
+ fn __bindgen_test_layout_B_open0_ref_int_close0_instantiation ( ) {
483
+ assert_eq ! ( :: std:: mem:: size_of:: <B <* mut :: std:: os:: raw:: c_int>>( ) , 8usize
484
+ , concat ! (
485
+ "Size of template specialization: " , stringify ! (
486
+ B <* mut :: std:: os:: raw:: c_int> ) ) ) ;
487
+ assert_eq ! ( :: std:: mem:: align_of:: <B <* mut :: std:: os:: raw:: c_int>>( ) ,
488
+ 8usize , concat ! (
489
+ "Alignment of template specialization: " , stringify ! (
490
+ B <* mut :: std:: os:: raw:: c_int> ) ) ) ;
491
+ }
492
+ #[ test]
493
+ fn __bindgen_test_layout_B_open0_ref_const_int_close0_instantiation ( ) {
494
+ assert_eq ! ( :: std:: mem:: size_of:: <B <* const :: std:: os:: raw:: c_int>>( ) ,
495
+ 8usize , concat ! (
496
+ "Size of template specialization: " , stringify ! (
497
+ B <* const :: std:: os:: raw:: c_int> ) ) ) ;
498
+ assert_eq ! ( :: std:: mem:: align_of:: <B <* const :: std:: os:: raw:: c_int>>( ) ,
499
+ 8usize , concat ! (
500
+ "Alignment of template specialization: " , stringify ! (
501
+ B <* const :: std:: os:: raw:: c_int> ) ) ) ;
502
+ }
503
+ #[ test]
504
+ fn __bindgen_test_layout_B_open0_ref_ptr_int_close0_instantiation ( ) {
505
+ assert_eq ! ( :: std:: mem:: size_of:: <B <* mut * mut :: std:: os:: raw:: c_int>>( ) ,
506
+ 8usize , concat ! (
507
+ "Size of template specialization: " , stringify ! (
508
+ B <* mut * mut :: std:: os:: raw:: c_int> ) ) ) ;
509
+ assert_eq ! ( :: std:: mem:: align_of:: <B <* mut * mut :: std:: os:: raw:: c_int>>( ) ,
510
+ 8usize , concat ! (
511
+ "Alignment of template specialization: " , stringify ! (
512
+ B <* mut * mut :: std:: os:: raw:: c_int> ) ) ) ;
513
+ }
514
+ #[ test]
515
+ fn __bindgen_test_layout_B_open0_ref_array1_int_close0_instantiation ( ) {
516
+ assert_eq ! ( :: std:: mem:: size_of:: <B <* mut [ :: std:: os:: raw:: c_int; 1usize ] >>( )
517
+ , 8usize , concat ! (
518
+ "Size of template specialization: " , stringify ! (
519
+ B <* mut [ :: std:: os:: raw:: c_int; 1usize ] > ) ) ) ;
520
+ assert_eq ! ( :: std:: mem:: align_of:: <B <* mut [ :: std:: os:: raw:: c_int; 1usize ] >>( )
521
+ , 8usize , concat ! (
522
+ "Alignment of template specialization: " , stringify ! (
523
+ B <* mut [ :: std:: os:: raw:: c_int; 1usize ] > ) ) ) ;
524
+ }
525
+ #[ test]
407
526
fn __bindgen_test_layout_Foo_open0_int_int_close0_instantiation_1 ( ) {
408
527
assert_eq ! ( :: std:: mem:: size_of:: <Foo <:: std:: os:: raw:: c_int>>( ) , 24usize ,
409
528
concat ! (
0 commit comments