Skip to content

Commit 5912dad

Browse files
committed
Add test.
1 parent f23e76e commit 5912dad

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Regression test for https://github.com/rust-lang/rust/issues/138696
2+
//@ run-pass
3+
4+
#![feature(rustc_private)]
5+
6+
extern crate libc;
7+
8+
fn main() {
9+
std::thread::spawn(|| {
10+
unsafe { libc::atexit(spawn_in_atexit) };
11+
})
12+
.join()
13+
.unwrap();
14+
}
15+
16+
extern "C" fn spawn_in_atexit() {
17+
std::thread::spawn(|| {
18+
println!("Thread spawned in atexit");
19+
})
20+
.join()
21+
.unwrap();
22+
}

0 commit comments

Comments
 (0)