1- #![ feature( portable_simd) ]
21use std:: mem;
32use std:: num;
4- use std:: simd;
53
64#[ derive( Copy , Clone ) ]
75struct Zst ;
@@ -56,19 +54,15 @@ fn test_abi_newtype<T: Copy>(t: T) {
5654
5755fn main ( ) {
5856 // Here we check:
59- // - unsigned vs signed integer is allowed
60- // - u32/i32 vs char is allowed
57+ // - u32 vs char is allowed
6158 // - u32 vs NonZeroU32/Option<NonZeroU32> is allowed
6259 // - reference vs raw pointer is allowed
6360 // - references to things of the same size and alignment are allowed
6461 // These are very basic tests that should work on all ABIs. However it is not clear that any of
6562 // these would be stably guaranteed. Code that relies on this is equivalent to code that relies
6663 // on the layout of `repr(Rust)` types. They are also fragile: the same mismatches in the fields
6764 // 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 ) ) ;
7065 test_abi_compat ( 0u32 , 'x' ) ;
71- test_abi_compat ( 0i32 , 'x' ) ;
7266 test_abi_compat ( 42u32 , num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ;
7367 test_abi_compat ( 0u32 , Some ( num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ) ;
7468 test_abi_compat ( & 0u32 , & 0u32 as * const u32 ) ;
@@ -83,9 +77,6 @@ fn main() {
8377 test_abi_newtype ( 0u32 ) ;
8478 test_abi_newtype ( 0f32 ) ;
8579 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 ] ) ;
9182}
0 commit comments