about summary refs log tree commit diff
path: root/src/test/codegen/zst-offset.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/codegen/zst-offset.rs')
-rw-r--r--src/test/codegen/zst-offset.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/codegen/zst-offset.rs b/src/test/codegen/zst-offset.rs
index 3c63cddccad..0c015fca325 100644
--- a/src/test/codegen/zst-offset.rs
+++ b/src/test/codegen/zst-offset.rs
@@ -1,6 +1,7 @@
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
+#![feature(repr_simd)]
 
 // Hack to get the correct size for the length part in slices
 // CHECK: @helper([[USIZE:i[0-9]+]] %_1)
@@ -27,3 +28,16 @@ pub fn scalarpair_layout(s: &(u64, u32, ())) {
     let x = &s.2;
     &x; // keep variable in an alloca
 }
+
+#[repr(simd)]
+pub struct U64x4(u64, u64, u64, u64);
+
+// Check that we correctly generate a GEP for a ZST that is not included in Vector layout
+// CHECK-LABEL: @vector_layout
+#[no_mangle]
+pub fn vector_layout(s: &(U64x4, ())) {
+// CHECK: [[X0:%[0-9]+]] = bitcast <4 x i64>* %s to i8*
+// CHECK-NEXT: [[X1:%[0-9]+]] = getelementptr i8, i8* [[X0]], [[USIZE]] 32
+    let x = &s.1;
+    &x; // keep variable in an alloca
+}