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