2020-09-24 16:10:26 +00:00
|
|
|
//@ run-pass
|
|
|
|
//@ check-run-results
|
2020-09-26 09:47:26 +00:00
|
|
|
//@ ignore-emscripten
|
2024-04-18 21:49:07 +00:00
|
|
|
//@ only-unix
|
2020-09-26 09:47:26 +00:00
|
|
|
|
|
|
|
// Emscripten doesn't flush its own stdout buffers on exit, which would fail
|
|
|
|
// this test. So this test is disabled on this platform.
|
|
|
|
// See https://emscripten.org/docs/getting_started/FAQ.html#what-does-exiting-the-runtime-mean-why-don-t-atexit-s-run
|
2020-09-24 16:10:26 +00:00
|
|
|
|
|
|
|
#![feature(rustc_private)]
|
|
|
|
|
|
|
|
extern crate libc;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
extern "C" fn bye() {
|
|
|
|
print!(", world!");
|
|
|
|
}
|
|
|
|
unsafe { libc::atexit(bye) };
|
|
|
|
print!("hello");
|
|
|
|
}
|