2019-07-26 21:54:25 +00:00
|
|
|
// run-pass
|
2017-10-18 01:45:42 +00:00
|
|
|
// ignore-emscripten no processes
|
2019-04-24 16:26:33 +00:00
|
|
|
// ignore-sgx no processes
|
2018-01-02 13:11:41 +00:00
|
|
|
// ignore-windows
|
2022-09-19 21:02:42 +00:00
|
|
|
// ignore-fuchsia code returned as ZX_TASK_RETCODE_EXCEPTION_KILL, FIXME (#58590)
|
2013-11-12 01:37:14 +00:00
|
|
|
|
2015-02-16 14:04:02 +00:00
|
|
|
use std::env;
|
2015-04-10 18:12:43 +00:00
|
|
|
use std::process::Command;
|
2013-11-12 01:37:14 +00:00
|
|
|
|
2014-01-03 23:30:54 +00:00
|
|
|
pub fn main() {
|
2015-02-16 14:04:02 +00:00
|
|
|
let args: Vec<String> = env::args().collect();
|
2015-02-02 02:53:25 +00:00
|
|
|
if args.len() >= 2 && args[1] == "signal" {
|
2013-11-12 01:37:14 +00:00
|
|
|
// Raise a segfault.
|
2016-08-30 02:34:21 +00:00
|
|
|
unsafe { *(1 as *mut isize) = 0; }
|
2013-11-12 01:37:14 +00:00
|
|
|
} else {
|
2015-02-02 02:53:25 +00:00
|
|
|
let status = Command::new(&args[0]).arg("signal").status().unwrap();
|
2015-04-10 18:12:43 +00:00
|
|
|
assert!(status.code().is_none());
|
2013-11-12 01:37:14 +00:00
|
|
|
}
|
|
|
|
}
|