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

10 lines
349 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 {
2022-03-09 18:26:40 -06:00
let vec: &[i8] = &[10, 11, 12, 13, 14, 15, 16, 17, 18];
2022-03-09 18:18:07 -06:00
let idxs = Simd::from_array([9, 3, 0, 17]);
let _result = Simd::gather_select_unchecked(&vec, Mask::splat(true), idxs, Simd::splat(0));
} }