rust/tests/run-make-fulldeps/static-unwinding/main.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
373 B
Rust
Raw Normal View History

extern crate lib;
2015-02-17 21:00:20 -06:00
use std::thread;
2015-02-17 21:00:20 -06:00
static mut statik: isize = 0;
struct A;
impl Drop for A {
fn drop(&mut self) {
unsafe { statik = 1; }
}
}
fn main() {
2015-02-17 21:00:20 -06:00
thread::spawn(move|| {
let _a = A;
lib::callback(|| panic!());
}).join().unwrap_err();
unsafe {
assert_eq!(lib::statik, 1);
assert_eq!(statik, 1);
}
}