summaryrefslogtreecommitdiffstats
path: root/tests/run-make-fulldeps/static-unwinding/main.rs
blob: 0c66ea1aa07fc8e7dc05472110a5559d6f886078 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
extern crate lib;

use std::thread;

static mut statik: isize = 0;

struct A;
impl Drop for A {
    fn drop(&mut self) {
        unsafe { statik = 1; }
    }
}

fn main() {
    thread::spawn(move|| {
        let _a = A;
        lib::callback(|| panic!());
    }).join().unwrap_err();

    unsafe {
        assert_eq!(lib::statik, 1);
        assert_eq!(statik, 1);
    }
}