mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
433da1fc04
They pass fine.
30 lines
366 B
Rust
30 lines
366 B
Rust
#[link(name = "foo", kind = "static")]
|
|
extern "C" {
|
|
fn test_start(f: extern "C" fn());
|
|
fn test_end();
|
|
}
|
|
|
|
fn main() {
|
|
unsafe {
|
|
test_start(test_middle);
|
|
}
|
|
}
|
|
|
|
struct A;
|
|
|
|
impl Drop for A {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
extern "C" fn test_middle() {
|
|
let _a = A;
|
|
foo();
|
|
}
|
|
|
|
fn foo() {
|
|
let _a = A;
|
|
unsafe {
|
|
test_end();
|
|
}
|
|
}
|