about summary refs log tree commit diff
path: root/tests/ui/runtime/on-broken-pipe/with-rustc_main.rs
blob: c40590ad87f47edf5f12646b3141f9de196a6083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ run-pass
//@ aux-build:sigpipe-utils.rs
//@ compile-flags: -Zon-broken-pipe=kill
//@ only-unix because SIGPIPE is a unix thing

#![feature(rustc_attrs)]

#[rustc_main]
fn rustc_main() {
    extern crate sigpipe_utils;

    // `-Zon-broken-pipe=kill` is active, so SIGPIPE handler shall be
    // SIG_DFL. Note that we have a #[rustc_main], but it should still work.
    sigpipe_utils::assert_sigpipe_handler(sigpipe_utils::SignalHandler::Default);
}