]> git.proxmox.com Git - rustc.git/blob - src/test/run-pass/simd-upgraded.rs
New upstream version 1.12.0+dfsg1
[rustc.git] / src / test / run-pass / simd-upgraded.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Test that removed LLVM SIMD intrinsics continue
12 // to work via the "AutoUpgrade" mechanism.
13
14 #![feature(cfg_target_feature, repr_simd)]
15 #![feature(platform_intrinsics, stmt_expr_attributes)]
16
17 #[repr(simd)]
18 #[derive(PartialEq, Debug)]
19 struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
20
21 fn main() {
22 #[cfg(target_feature = "sse2")] unsafe {
23 extern "platform-intrinsic" {
24 fn x86_mm_min_epi16(x: i16x8, y: i16x8) -> i16x8;
25 }
26 assert_eq!(x86_mm_min_epi16(i16x8(0, 1, 2, 3, 4, 5, 6, 7),
27 i16x8(7, 6, 5, 4, 3, 2, 1, 0)),
28 i16x8(0, 1, 2, 3, 3, 2, 1, 0));
29 };
30 }