1
- #![ feature( portable_simd) ]
2
1
use std:: mem;
3
2
use std:: num;
4
- use std:: simd;
5
3
6
4
#[ derive( Copy , Clone ) ]
7
5
struct Zst ;
@@ -56,19 +54,15 @@ fn test_abi_newtype<T: Copy>(t: T) {
56
54
57
55
fn main ( ) {
58
56
// Here we check:
59
- // - unsigned vs signed integer is allowed
60
- // - u32/i32 vs char is allowed
57
+ // - u32 vs char is allowed
61
58
// - u32 vs NonZeroU32/Option<NonZeroU32> is allowed
62
59
// - reference vs raw pointer is allowed
63
60
// - references to things of the same size and alignment are allowed
64
61
// These are very basic tests that should work on all ABIs. However it is not clear that any of
65
62
// these would be stably guaranteed. Code that relies on this is equivalent to code that relies
66
63
// on the layout of `repr(Rust)` types. They are also fragile: the same mismatches in the fields
67
64
// of a struct (even with `repr(C)`) will not always be accepted by Miri.
68
- test_abi_compat ( 0u32 , 0i32 ) ;
69
- test_abi_compat ( simd:: u32x8:: splat ( 1 ) , simd:: i32x8:: splat ( 1 ) ) ;
70
65
test_abi_compat ( 0u32 , 'x' ) ;
71
- test_abi_compat ( 0i32 , 'x' ) ;
72
66
test_abi_compat ( 42u32 , num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ;
73
67
test_abi_compat ( 0u32 , Some ( num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ) ;
74
68
test_abi_compat ( & 0u32 , & 0u32 as * const u32 ) ;
@@ -83,9 +77,6 @@ fn main() {
83
77
test_abi_newtype ( 0u32 ) ;
84
78
test_abi_newtype ( 0f32 ) ;
85
79
test_abi_newtype ( ( 0u32 , 1u32 , 2u32 ) ) ;
86
- // FIXME: skipping the array tests on mips64 due to https://github.com/rust-lang/rust/issues/115404
87
- if !cfg ! ( target_arch = "mips64" ) {
88
- test_abi_newtype ( [ 0u32 , 1u32 , 2u32 ] ) ;
89
- test_abi_newtype ( [ 0i32 ; 0 ] ) ;
90
- }
80
+ test_abi_newtype ( [ 0u32 , 1u32 , 2u32 ] ) ;
81
+ test_abi_newtype ( [ 0i32 ; 0 ] ) ;
91
82
}
0 commit comments