2019-07-26 21:54:25 +00:00
|
|
|
//@ run-pass
|
2024-03-06 20:44:54 +00:00
|
|
|
//@ ignore-wasm32 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
|
|
|
|
2023-03-29 01:37:15 +00:00
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
|
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" {
|
2023-03-29 01:37:15 +00:00
|
|
|
// Raise an aborting signal without UB
|
|
|
|
core::intrinsics::abort();
|
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
|
|
|
}
|
|
|
|
}
|