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 12:13:20 -05:00
// Regression test for #29988
2020-05-07 10:51:13 -05:00
// compile-flags: -C no-prepopulate-passes
// only-x86_64
// ignore-windows
2020-05-06 12:13:20 -05:00
#[repr(C)]
struct S {
f1: i32,
f2: i32,
f3: i32,
}
2020-09-01 16:12:52 -05:00
extern "C" {
2020-05-06 12:13:20 -05: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 12:13:20 -05:00
// CHECK: call void @foo({ i64, i32 } {{.*}})
foo(s);
}
}