File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1370,3 +1370,19 @@ fn test_append_regression_i29() {
13701370 assert_eq ! ( rs. rank0, 63 ) ;
13711371 assert_eq ! ( rs. rank1, 1 ) ;
13721372}
1373+
1374+ #[ test]
1375+ fn test_simd_fallback ( ) {
1376+ // Test case that should fail if run with SIMD enabled if the SIMD implementation attempts
1377+ // to load a non-full block into a full SIMD register.
1378+ // If implemented correctly, the SIMD implementation falls back to the non-SIMD implementation
1379+ // to avoid out of bounds reads. It is likely that other test cases fail as well, but this
1380+ // explicitly exists to test this case.
1381+ let bv = BitVec :: from_zeros ( SUPER_BLOCK_SIZE + 3 * BLOCK_SIZE + 3 ) ;
1382+ let rs = RsVec :: from_bit_vec ( bv) ;
1383+
1384+ assert_eq ! (
1385+ rs. select0( SUPER_BLOCK_SIZE + 3 * BLOCK_SIZE + 1 ) ,
1386+ SUPER_BLOCK_SIZE + 3 * BLOCK_SIZE + 1
1387+ ) ;
1388+ }
You can’t perform that action at this time.
0 commit comments