bb531083cc
Destructor are removed from stack because it's considered UB.
22 lines
276 B
Rust
22 lines
276 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);
|
|
}
|
|
}
|
|
|
|
extern "C" fn test_middle() {
|
|
foo();
|
|
}
|
|
|
|
fn foo() {
|
|
unsafe {
|
|
test_end();
|
|
}
|
|
}
|