Add test.

This commit is contained in:
Mara Bos 2025-03-19 12:49:41 +01:00
parent f23e76e0d2
commit 5912dadf08

View file

@ -0,0 +1,22 @@
// Regression test for https://github.com/rust-lang/rust/issues/138696
//@ run-pass
#![feature(rustc_private)]
extern crate libc;
fn main() {
std::thread::spawn(|| {
unsafe { libc::atexit(spawn_in_atexit) };
})
.join()
.unwrap();
}
extern "C" fn spawn_in_atexit() {
std::thread::spawn(|| {
println!("Thread spawned in atexit");
})
.join()
.unwrap();
}