2021-03-02 02:41:41 -06:00
|
|
|
// run-pass
|
2018-03-16 13:42:42 -05:00
|
|
|
// ignore-emscripten FIXME(#45351)
|
|
|
|
|
2017-07-24 21:31:59 -05:00
|
|
|
#![feature(repr_simd, platform_intrinsics)]
|
|
|
|
|
|
|
|
#[repr(simd)]
|
|
|
|
#[derive(Copy, Clone, Debug)]
|
2019-12-31 14:25:16 -06:00
|
|
|
pub struct Char3(pub i8, pub i8, pub i8);
|
2017-07-24 21:31:59 -05:00
|
|
|
|
|
|
|
#[repr(simd)]
|
|
|
|
#[derive(Copy, Clone, Debug)]
|
2019-12-31 14:25:16 -06:00
|
|
|
pub struct Short3(pub i16, pub i16, pub i16);
|
2017-07-24 21:31:59 -05:00
|
|
|
|
|
|
|
extern "platform-intrinsic" {
|
|
|
|
fn simd_cast<T, U>(x: T) -> U;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2019-12-31 14:25:16 -06:00
|
|
|
let cast: Short3 = unsafe { simd_cast(Char3(10, -3, -9)) };
|
2017-07-24 21:31:59 -05:00
|
|
|
|
|
|
|
println!("{:?}", cast);
|
|
|
|
}
|