about summary refs log tree commit diff
path: root/src/test/codegen/zst-offset.rs
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2020-08-20 18:59:52 -0400
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2020-08-30 14:58:03 -0400
commit24e0913e37cc6fc363b37d13bf519db212f175a2 (patch)
tree822e4cafc7346bc9497c1b2025195a48590107bd /src/test/codegen/zst-offset.rs
parent6fc1d8bc13124bb134d7ab54e56237821a55912e (diff)
downloadrust-24e0913e37cc6fc363b37d13bf519db212f175a2.tar.gz
rust-24e0913e37cc6fc363b37d13bf519db212f175a2.zip
handle vector layout
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
+}