about summary refs log tree commit diff
path: root/tests/codegen/simd/project-to-simd-array-field.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-21 02:31:56 +0000
committerbors <bors@rust-lang.org>2025-07-21 02:31:56 +0000
commite05ab47e6c418fb2b9faa2eae9a7e70c65c98eaa (patch)
treecfa5e765a3479a007839b9ced139ff8199f56ad6 /tests/codegen/simd/project-to-simd-array-field.rs
parent460259d14de0274b97b8801e08cb2fe5f16fdac5 (diff)
parent41ce1ed252f194756fb2f3e3e92bbdfb3940088d (diff)
downloadrust-e05ab47e6c418fb2b9faa2eae9a7e70c65c98eaa.tar.gz
rust-e05ab47e6c418fb2b9faa2eae9a7e70c65c98eaa.zip
Auto merge of #143833 - scottmcm:final-mcp-838, r=compiler-errors
Ban projecting into SIMD types [MCP838]

Closes https://github.com/rust-lang/compiler-team/issues/838

The actual compiler change here is tiny; there's just a bazillion tests to update.

~~Since I'm sure I've missed some, for now~~
~~r ghost~~

try-job: test-various
try-job: x86_64-gnu-nopt
Diffstat (limited to 'tests/codegen/simd/project-to-simd-array-field.rs')
-rw-r--r--tests/codegen/simd/project-to-simd-array-field.rs31
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/codegen/simd/project-to-simd-array-field.rs b/tests/codegen/simd/project-to-simd-array-field.rs
deleted file mode 100644
index 29fab640633..00000000000
--- a/tests/codegen/simd/project-to-simd-array-field.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-//@compile-flags: -Copt-level=3
-
-#![crate_type = "lib"]
-#![feature(repr_simd, core_intrinsics)]
-
-#[allow(non_camel_case_types)]
-#[derive(Clone, Copy)]
-#[repr(simd)]
-struct i32x4([i32; 4]);
-
-#[inline(always)]
-fn to_array4(a: i32x4) -> [i32; 4] {
-    a.0
-}
-
-// CHECK-LABEL: simd_add_self_then_return_array(
-// CHECK-SAME: ptr{{.+}}sret{{.+}}%[[RET:.+]],
-// CHECK-SAME: ptr{{.+}}%a)
-#[no_mangle]
-pub fn simd_add_self_then_return_array(a: &i32x4) -> [i32; 4] {
-    // It would be nice to just ban `.0` into simd types,
-    // but until we do this has to keep working.
-    // See also <https://github.com/rust-lang/rust/issues/105439>
-
-    // CHECK: %[[T1:.+]] = load <4 x i32>, ptr %a
-    // CHECK: %[[T2:.+]] = shl <4 x i32> %[[T1]], {{splat \(i32 1\)|<i32 1, i32 1, i32 1, i32 1>}}
-    // CHECK: store <4 x i32> %[[T2]], ptr %[[RET]]
-    let a = *a;
-    let b = unsafe { core::intrinsics::simd::simd_add(a, a) };
-    to_array4(b)
-}