about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/issues/issue-122600-ptr-discriminant-update.rs19
-rw-r--r--tests/codegen/simd/issue-120720-reduce-nan.rs21
2 files changed, 19 insertions, 21 deletions
diff --git a/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs b/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs
new file mode 100644
index 00000000000..4b520a62069
--- /dev/null
+++ b/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs
@@ -0,0 +1,19 @@
+//@ compile-flags: -O
+//@ min-llvm-version: 19
+
+#![crate_type = "lib"]
+
+pub enum State {
+    A([u8; 753]),
+    B([u8; 753]),
+}
+
+// CHECK-LABEL: @update
+#[no_mangle]
+pub unsafe fn update(s: *mut State) {
+    // CHECK-NEXT: start:
+    // CHECK-NEXT: store i8
+    // CHECK-NEXT: ret
+    let State::A(v) = s.read() else { std::hint::unreachable_unchecked() };
+    s.write(State::B(v));
+}
diff --git a/tests/codegen/simd/issue-120720-reduce-nan.rs b/tests/codegen/simd/issue-120720-reduce-nan.rs
deleted file mode 100644
index 13af0bb076e..00000000000
--- a/tests/codegen/simd/issue-120720-reduce-nan.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-//@ compile-flags: -C opt-level=3 -C target-cpu=cannonlake
-//@ only-x86_64
-
-// In a previous implementation, _mm512_reduce_add_pd did the reduction with all fast-math flags
-// enabled, making it UB to reduce a vector containing a NaN.
-
-#![crate_type = "lib"]
-#![feature(stdarch_x86_avx512, avx512_target_feature)]
-use std::arch::x86_64::*;
-
-// CHECK-LABEL: @demo(
-#[no_mangle]
-#[target_feature(enable = "avx512f")] // Function-level target feature mismatches inhibit inlining
-pub unsafe fn demo() -> bool {
-    // CHECK: %0 = tail call reassoc double @llvm.vector.reduce.fadd.v8f64(
-    // CHECK: %_0.i = fcmp uno double %0, 0.000000e+00
-    // CHECK: ret i1 %_0.i
-    let res =
-        unsafe { _mm512_reduce_add_pd(_mm512_set_pd(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, f64::NAN)) };
-    res.is_nan()
-}