]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/sepcomp/sepcomp-unwind.rs
New upstream version 1.37.0+dfsg1
[rustc.git] / src / test / run-pass / sepcomp / sepcomp-unwind.rs
CommitLineData
b7449926 1// run-pass
0bf4aa26 2#![allow(dead_code)]
1a4d82fc 3// compile-flags: -C codegen-units=3
7453a54e 4// ignore-emscripten no threads support
1a4d82fc
JJ
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
c34b1796 15
85aaf69f 16use std::thread;
1a4d82fc 17
c34b1796 18fn pad() -> usize { 0 }
1a4d82fc
JJ
19
20mod a {
21 pub fn f() {
22 panic!();
23 }
24}
25
26mod b {
27 pub fn g() {
28 ::a::f();
29 }
30}
31
32fn main() {
a7813a04 33 thread::spawn(move|| { ::b::g() }).join().unwrap_err();
1a4d82fc 34}