rust/tests/codegen/ffi-out-of-bounds-loads.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
401 B
Rust
Raw Normal View History

2020-05-06 17:13:20 +00:00
// Regression test for #29988
2020-05-07 15:51:13 +00:00
// compile-flags: -C no-prepopulate-passes
// only-x86_64
// ignore-windows
2020-05-06 17:13:20 +00:00
#[repr(C)]
struct S {
f1: i32,
f2: i32,
f3: i32,
}
2020-09-01 21:12:52 +00:00
extern "C" {
2020-05-06 17:13:20 +00:00
fn foo(s: S);
}
fn main() {
let s = S { f1: 1, f2: 2, f3: 3 };
unsafe {
// CHECK: load { i64, i32 }, {{.*}}, align 4
2020-05-06 17:13:20 +00:00
// CHECK: call void @foo({ i64, i32 } {{.*}})
foo(s);
}
}