]> git.proxmox.com Git - rustc.git/blame - src/test/codegen/ffi-out-of-bounds-loads.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / codegen / ffi-out-of-bounds-loads.rs
CommitLineData
f9f354fc
XL
1// Regression test for #29988
2
3// compile-flags: -C no-prepopulate-passes
4// only-x86_64
5// ignore-windows
6
7#[repr(C)]
8struct S {
9 f1: i32,
10 f2: i32,
11 f3: i32,
12}
13
5869c6ff 14extern "C" {
f9f354fc
XL
15 fn foo(s: S);
16}
17
18fn main() {
19 let s = S { f1: 1, f2: 2, f3: 3 };
20 unsafe {
21 // CHECK: load { i64, i32 }, { i64, i32 }* {{.*}}, align 4
22 // CHECK: call void @foo({ i64, i32 } {{.*}})
23 foo(s);
24 }
25}