3 // ignore-emscripten no threads support
5 // Check that the destructors of simple enums are run on unwinding
7 use std::sync::atomic::{Ordering, AtomicUsize};
10 static LOG: AtomicUsize = AtomicUsize::new(0);
13 impl Drop for WithDtor {
15 LOG.store(LOG.load(Ordering::SeqCst)+1,Ordering::SeqCst);
20 thread::spawn(move|| {
21 let _e: WithDtor = WithDtor::Val;
23 }).join().unwrap_err();
25 assert_eq!(LOG.load(Ordering::SeqCst), 1);