summaryrefslogtreecommitdiffstats
path: root/src/test/ui/process/issue-20091.rs
blob: 86cc79d6b4244f1d0fa8082229d756c1374c7656 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// run-pass
#![allow(stable_features)]

// ignore-emscripten no processes
// ignore-sgx no processes

#![feature(os)]

#[cfg(unix)]
fn main() {
    use std::process::Command;
    use std::env;
    use std::os::unix::prelude::*;
    use std::ffi::OsStr;

    if env::args().len() == 1 {
        assert!(Command::new(&env::current_exe().unwrap())
                        .arg(<OsStr as OsStrExt>::from_bytes(b"\xff"))
                        .status().unwrap().success())
    }
}

#[cfg(windows)]
fn main() {}