1 #![allow(unused_must_use)]
2 // Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
3 // we never unwind through them.
5 // ignore-cloudabi no env and process
6 // ignore-emscripten no processes
7 // ignore-sgx no processes
10 use std::io::prelude::*;
12 use std::process::{Command, Stdio};
14 extern "C" fn panic_in_ffi() {
19 let _ = panic::catch_unwind(|| { panic_in_ffi(); });
20 // The process should have aborted by now.
21 io::stdout().write(b"This should never be printed.\n");
22 let _ = io::stdout().flush();
26 let args: Vec<String> = env::args().collect();
27 if args.len() > 1 && args[1] == "test" {
31 let mut p = Command::new(&args[0])
32 .stdout(Stdio::piped())
33 .stdin(Stdio::piped())
34 .arg("test").spawn().unwrap();
35 assert!(!p.wait().unwrap().success());