2019-07-27 00:54:25 +03:00
|
|
|
//@ run-pass
|
2024-03-06 12:44:54 -08:00
|
|
|
//@ ignore-wasm32 no processes
|
2019-04-24 09:26:33 -07:00
|
|
|
//@ ignore-sgx no processes
|
2018-01-02 14:11:41 +01: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 11:37:14 +10:00
|
|
|
|
2023-03-28 21:37:15 -04:00
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
|
2015-02-16 16:04:02 +02:00
|
|
|
use std::env;
|
2015-04-10 11:12:43 -07:00
|
|
|
use std::process::Command;
|
2013-11-12 11:37:14 +10:00
|
|
|
|
2014-01-03 15:30:54 -08:00
|
|
|
pub fn main() {
|
2015-02-16 16:04:02 +02:00
|
|
|
let args: Vec<String> = env::args().collect();
|
2015-02-01 21:53:25 -05:00
|
|
|
if args.len() >= 2 && args[1] == "signal" {
|
2023-03-28 21:37:15 -04:00
|
|
|
// Raise an aborting signal without UB
|
|
|
|
core::intrinsics::abort();
|
2013-11-12 11:37:14 +10:00
|
|
|
} else {
|
2015-02-01 21:53:25 -05:00
|
|
|
let status = Command::new(&args[0]).arg("signal").status().unwrap();
|
2015-04-10 11:12:43 -07:00
|
|
|
assert!(status.code().is_none());
|
2013-11-12 11:37:14 +10:00
|
|
|
}
|
|
|
|
}
|