rust/src/test/run-make/static-unwinding/main.rs

26 lines
350 B
Rust
Raw Normal View History

extern mod lib;
use std::task;
static mut statik: int = 0;
struct A;
impl Drop for A {
fn drop(&mut self) {
unsafe { statik = 1; }
}
}
fn main() {
2014-01-27 17:29:50 -06:00
task::try(proc() {
let _a = A;
lib::callback(|| fail!());
1
2014-01-27 17:29:50 -06:00
});
unsafe {
assert!(lib::statik == 1);
assert!(statik == 1);
}
}