summaryrefslogtreecommitdiffstats
path: root/src/test/ui/runtime/stdout-during-shutdown.rs
blob: a6cf812ca644eaf814d8dd73da597ee1cb5cbe91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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");
}