]> git.lizzy.rs Git - rust.git/blob - tests/run-make-fulldeps/static-unwinding/main.rs
Rollup merge of #106323 - starkat99:stabilize-f16c_target_feature, r=petrochenkov
[rust.git] / tests / run-make-fulldeps / static-unwinding / main.rs
1 extern crate lib;
2
3 use std::thread;
4
5 static mut statik: isize = 0;
6
7 struct A;
8 impl Drop for A {
9     fn drop(&mut self) {
10         unsafe { statik = 1; }
11     }
12 }
13
14 fn main() {
15     thread::spawn(move|| {
16         let _a = A;
17         lib::callback(|| panic!());
18     }).join().unwrap_err();
19
20     unsafe {
21         assert_eq!(lib::statik, 1);
22         assert_eq!(statik, 1);
23     }
24 }