]> git.lizzy.rs Git - rust.git/blob - src/test/ui/sepcomp/sepcomp-unwind.rs
Auto merge of #86155 - alexcrichton:abort-on-unwind, r=nikomatsakis
[rust.git] / src / test / ui / sepcomp / sepcomp-unwind.rs
1 // run-pass
2 #![allow(dead_code)]
3 // compile-flags: -C codegen-units=3
4 // ignore-emscripten no threads support
5
6 // Test unwinding through multiple compilation units.
7
8 // According to acrichto, in the distant past `ld -r` (which is used during
9 // linking when codegen-units > 1) was known to produce object files with
10 // damaged unwinding tables.  This may be related to GNU binutils bug #6893
11 // ("Partial linking results in corrupt .eh_frame_hdr"), but I'm not certain.
12 // In any case, this test should let us know if enabling parallel codegen ever
13 // breaks unwinding.
14
15
16 use std::thread;
17
18 fn pad() -> usize { 0 }
19
20 mod a {
21     pub fn f() {
22         panic!();
23     }
24 }
25
26 mod b {
27     pub fn g() {
28         ::a::f();
29     }
30 }
31
32 fn main() {
33     thread::spawn(move|| { ::b::g() }).join().unwrap_err();
34 }