]> git.lizzy.rs Git - rust.git/blob - library/portable-simd/crates/core_simd/tests/autoderef.rs
Auto merge of #91500 - ehuss:update-mdbook, r=Mark-Simulacrum
[rust.git] / library / portable-simd / crates / core_simd / tests / autoderef.rs
1 // Test that we handle all our "auto-deref" cases correctly.
2 #![feature(portable_simd)]
3 use core_simd::f32x4;
4
5 #[cfg(target_arch = "wasm32")]
6 use wasm_bindgen_test::*;
7
8 #[cfg(target_arch = "wasm32")]
9 wasm_bindgen_test_configure!(run_in_browser);
10
11 #[test]
12 #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
13 fn deref() {
14     let x = f32x4::splat(1.0);
15     let y = f32x4::splat(2.0);
16     let a = &x;
17     let b = &y;
18     assert_eq!(f32x4::splat(3.0), x + y);
19     assert_eq!(f32x4::splat(3.0), x + b);
20     assert_eq!(f32x4::splat(3.0), a + y);
21     assert_eq!(f32x4::splat(3.0), a + b);
22 }