about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-16 09:19:26 +0000
committerbors <bors@rust-lang.org>2022-04-16 09:19:26 +0000
commitc8422403f775126c40d558838d321c063554c822 (patch)
tree931c38fb5db853c1a2bbb0d0fa585a533df76b9f /src/test/codegen
parent07bb916d44a66d2caba427c7ee132bbeb245977b (diff)
parentf559cf98b5db32942ec9be050fecf58538910648 (diff)
downloadrust-c8422403f775126c40d558838d321c063554c822.tar.gz
rust-c8422403f775126c40d558838d321c063554c822.zip
Auto merge of #96108 - Dylan-DPC:rollup-t5f2fc9, r=Dylan-DPC
Rollup of 9 pull requests

Successful merges:

 - #93969 (Only add codegen backend to dep info if -Zbinary-dep-depinfo is used)
 - #94605 (Add missing links in platform support docs)
 - #95372 (make unaligned_references lint deny-by-default)
 - #95859 (Improve diagnostics for unterminated nested block comment)
 - #95961 (implement SIMD gather/scatter via vector getelementptr)
 - #96004 (Consider lifetimes when comparing types for equality in MIR validator)
 - #96050 (Remove some now-dead code that was only relevant before deaggregation.)
 - #96070 ([test] Add test cases for untested functions for BTreeMap)
 - #96099 (MaybeUninit array cleanup)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/simd_arith_offset.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/codegen/simd_arith_offset.rs b/src/test/codegen/simd_arith_offset.rs
new file mode 100644
index 00000000000..a858270d4e7
--- /dev/null
+++ b/src/test/codegen/simd_arith_offset.rs
@@ -0,0 +1,26 @@
+// compile-flags: -C no-prepopulate-passes
+// only-64bit (because the LLVM type of i64 for usize shows up)
+//
+
+#![crate_type = "lib"]
+#![feature(repr_simd, platform_intrinsics)]
+
+extern "platform-intrinsic" {
+    pub(crate) fn simd_arith_offset<T, U>(ptrs: T, offsets: U) -> T;
+}
+
+/// A vector of *const T.
+#[derive(Debug, Copy, Clone)]
+#[repr(simd)]
+pub struct SimdConstPtr<T, const LANES: usize>([*const T; LANES]);
+
+#[derive(Debug, Copy, Clone)]
+#[repr(simd)]
+pub struct Simd<T, const LANES: usize>([T; LANES]);
+
+// CHECK-LABEL: smoke
+#[no_mangle]
+pub fn smoke(ptrs: SimdConstPtr<u8, 8>, offsets: Simd<usize, 8>) -> SimdConstPtr<u8, 8> {
+    // CHECK: getelementptr i8, <8 x i8*> %_3, <8 x i64> %_4
+    unsafe { simd_arith_offset(ptrs, offsets) }
+}