about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-02-19 17:55:35 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-02-19 17:55:35 +0000
commit1af867cdf71965accfc30447bc80ff89deba0eff (patch)
treef6eedbc9c1c7256fab31e04a182d1ebabb9c25b2
parent916a6c17dfc53ac7535112fef3d256c56b282b12 (diff)
downloadrust-1af867cdf71965accfc30447bc80ff89deba0eff.tar.gz
rust-1af867cdf71965accfc30447bc80ff89deba0eff.zip
Add test for #1318
-rw-r--r--example/mini_core_hello_world.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index c00f8a2e0cd..39076f4902e 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -1,4 +1,4 @@
-#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local, box_syntax)]
+#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local, box_syntax, repr_simd)]
 #![no_core]
 #![allow(dead_code, non_camel_case_types)]
 
@@ -339,7 +339,15 @@ fn main() {
 
         assert_eq!(unsafe { intrinsics::size_of_val(x) }, 0);
         assert_eq!(unsafe { intrinsics::min_align_of_val(x) }, 1);
-}
+    }
+
+    #[repr(simd)]
+    struct V([f64; 2]);
+
+    unsafe {
+        let f = V([0.0, 1.0]);
+        let _a = f.0[0];
+    }
 }
 
 #[cfg(all(not(jit), target_arch = "x86_64", any(target_os = "linux", target_os = "darwin")))]