about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-12-06 18:58:05 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-12-25 18:01:07 +0000
commitb8ec86cabb10866b3c33c6e275b13e3709168ce8 (patch)
tree9d421743432db22710915d59a1bb625aede62578
parente300abb5931156de9d8c21700df203ee7814ccd8 (diff)
downloadrust-b8ec86cabb10866b3c33c6e275b13e3709168ce8.tar.gz
rust-b8ec86cabb10866b3c33c6e275b13e3709168ce8.zip
Adapt codegen test.
-rw-r--r--src/test/codegen/zst-offset.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/codegen/zst-offset.rs b/src/test/codegen/zst-offset.rs
index 29d2a1754a3..844d5870a84 100644
--- a/src/test/codegen/zst-offset.rs
+++ b/src/test/codegen/zst-offset.rs
@@ -15,7 +15,7 @@ pub fn helper(_: usize) {
 pub fn scalar_layout(s: &(u64, ())) {
 // CHECK: getelementptr i8, {{.+}}, [[USIZE]] 8
     let x = &s.1;
-    &x; // keep variable in an alloca
+    witness(&x); // keep variable in an alloca
 }
 
 // Check that we correctly generate a GEP for a ZST that is not included in ScalarPair layout
@@ -24,7 +24,7 @@ pub fn scalar_layout(s: &(u64, ())) {
 pub fn scalarpair_layout(s: &(u64, u32, ())) {
 // CHECK: getelementptr i8, {{.+}}, [[USIZE]] 12
     let x = &s.2;
-    &x; // keep variable in an alloca
+    witness(&x); // keep variable in an alloca
 }
 
 #[repr(simd)]
@@ -36,5 +36,8 @@ pub struct U64x4(u64, u64, u64, u64);
 pub fn vector_layout(s: &(U64x4, ())) {
 // CHECK: getelementptr i8, {{.+}}, [[USIZE]] 32
     let x = &s.1;
-    &x; // keep variable in an alloca
+    witness(&x); // keep variable in an alloca
 }
+
+#[inline(never)]
+fn witness(_: &impl Sized) {}