]> git.lizzy.rs Git - rust.git/blob - src/test/ui/panic-runtime/abort-link-to-unwinding-crates.rs
Rollup merge of #94577 - RalfJung:simd-miri, r=scottmcm
[rust.git] / src / test / ui / panic-runtime / abort-link-to-unwinding-crates.rs
1 // run-pass
2 #![allow(unused_variables)]
3 // compile-flags:-C panic=abort
4 // aux-build:exit-success-if-unwind.rs
5 // no-prefer-dynamic
6 // ignore-emscripten no processes
7 // ignore-sgx no processes
8 // ignore-macos
9
10 extern crate exit_success_if_unwind;
11
12 use std::process::Command;
13 use std::env;
14
15 fn main() {
16     let mut args = env::args_os();
17     let me = args.next().unwrap();
18
19     if let Some(s) = args.next() {
20         if &*s == "foo" {
21             exit_success_if_unwind::bar(do_panic);
22         }
23     }
24
25     let mut cmd = Command::new(env::args_os().next().unwrap());
26     cmd.arg("foo");
27
28
29     // ARMv6 hanges while printing the backtrace, see #41004
30     if cfg!(target_arch = "arm") && cfg!(target_env = "gnu") {
31         cmd.env("RUST_BACKTRACE", "0");
32     }
33
34     let s = cmd.status();
35     assert!(s.unwrap().code() != Some(0));
36 }
37
38 fn do_panic() {
39     panic!("try to catch me");
40 }