rust/tests/fail/intrinsics/simd-gather.rs

12 lines
369 B
Rust
Raw Normal View History

2022-03-09 18:26:40 -06:00
// error-pattern: pointer to 1 byte starting at offset 9 is out-of-bounds
2022-03-09 18:18:07 -06:00
#![feature(portable_simd)]
use std::simd::*;
fn main() {
unsafe {
let vec: &[i8] = &[10, 11, 12, 13, 14, 15, 16, 17, 18];
let idxs = Simd::from_array([9, 3, 0, 17]);
let _result = Simd::gather_select_unchecked(&vec, Mask::splat(true), idxs, Simd::splat(0));
}
}