Skip to content

Commit

Permalink
Add test for #29988
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed May 6, 2020
1 parent 339f574 commit 96d4e0b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/test/codegen/ffi-out-of-bounds-loads.rs
@@ -0,0 +1,22 @@
// compile-flags: -C no-prepopulate-passes
// Regression test for #29988

#[repr(C)]
struct S {
f1: i32,
f2: i32,
f3: i32,
}

extern {
fn foo(s: S);
}

fn main() {
let s = S { f1: 1, f2: 2, f3: 3 };
unsafe {
// CHECK: load { i64, i32 }, { i64, i32 }* {{.*}}, align 4
// CHECK: call void @foo({ i64, i32 } {{.*}})
foo(s);
}
}

0 comments on commit 96d4e0b

Please sign in to comment.