File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/test/ui/consts/const-eval/simd Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 77
88#[ repr( simd) ] struct i8x1 ( i8 ) ;
99#[ repr( simd) ] struct u16x2 ( u16 , u16 ) ;
10- // Make one of them an array type to ensure those also work.
10+ // Make some of them array types to ensure those also work.
11+ #[ repr( simd) ] struct i8x1_arr ( [ i8 ; 1 ] ) ;
1112#[ repr( simd) ] struct f32x4 ( [ f32 ; 4 ] ) ;
1213
1314extern "platform-intrinsic" {
@@ -26,6 +27,14 @@ fn main() {
2627 assert_eq ! ( X0 , 42 ) ;
2728 assert_eq ! ( Y0 , 42 ) ;
2829 }
30+ {
31+ const U : i8x1_arr = i8x1_arr ( [ 13 ] ) ;
32+ const V : i8x1_arr = unsafe { simd_insert ( U , 0_u32 , 42_i8 ) } ;
33+ const X0 : i8 = V . 0 [ 0 ] ;
34+ const Y0 : i8 = unsafe { simd_extract ( V , 0 ) } ;
35+ assert_eq ! ( X0 , 42 ) ;
36+ assert_eq ! ( Y0 , 42 ) ;
37+ }
2938 {
3039 const U : u16x2 = u16x2 ( 13 , 14 ) ;
3140 const V : u16x2 = unsafe { simd_insert ( U , 1_u32 , 42_u16 ) } ;
You can’t perform that action at this time.
0 commit comments