mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
20 lines
488 B
Rust
20 lines
488 B
Rust
//@ run-pass
|
|
//@ check-run-results
|
|
//@ ignore-emscripten
|
|
|
|
// 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
|
|
|
|
#![feature(rustc_private)]
|
|
|
|
extern crate libc;
|
|
|
|
fn main() {
|
|
extern "C" fn bye() {
|
|
print!(", world!");
|
|
}
|
|
unsafe { libc::atexit(bye) };
|
|
print!("hello");
|
|
}
|