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