Skip to content

Commit b8ec86c

Browse files
committed
Adapt codegen test.
1 parent e300abb commit b8ec86c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/test/codegen/zst-offset.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn helper(_: usize) {
1515
pub fn scalar_layout(s: &(u64, ())) {
1616
// CHECK: getelementptr i8, {{.+}}, [[USIZE]] 8
1717
let x = &s.1;
18-
&x; // keep variable in an alloca
18+
witness(&x); // keep variable in an alloca
1919
}
2020

2121
// 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, ())) {
2424
pub fn scalarpair_layout(s: &(u64, u32, ())) {
2525
// CHECK: getelementptr i8, {{.+}}, [[USIZE]] 12
2626
let x = &s.2;
27-
&x; // keep variable in an alloca
27+
witness(&x); // keep variable in an alloca
2828
}
2929

3030
#[repr(simd)]
@@ -36,5 +36,8 @@ pub struct U64x4(u64, u64, u64, u64);
3636
pub fn vector_layout(s: &(U64x4, ())) {
3737
// CHECK: getelementptr i8, {{.+}}, [[USIZE]] 32
3838
let x = &s.1;
39-
&x; // keep variable in an alloca
39+
witness(&x); // keep variable in an alloca
4040
}
41+
42+
#[inline(never)]
43+
fn witness(_: &impl Sized) {}

0 commit comments

Comments
 (0)