]>
Commit | Line | Data |
---|---|---|
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 | 16 | use std::thread; |
1a4d82fc | 17 | |
c34b1796 | 18 | fn pad() -> usize { 0 } |
1a4d82fc JJ |
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() { | |
a7813a04 | 33 | thread::spawn(move|| { ::b::g() }).join().unwrap_err(); |
1a4d82fc | 34 | } |