]> git.proxmox.com Git - rustc.git/blame - src/test/run-make-fulldeps/longjmp-across-rust/main.rs
New upstream version 1.33.0+dfsg1
[rustc.git] / src / test / run-make-fulldeps / longjmp-across-rust / main.rs
CommitLineData
0531ce1d
XL
1#[link(name = "foo", kind = "static")]
2extern {
3 fn test_start(f: extern fn());
4 fn test_end();
5}
1a4d82fc 6
0531ce1d
XL
7fn main() {
8 unsafe {
9 test_start(test_middle);
10 }
11}
1a4d82fc
JJ
12
13struct A;
0531ce1d 14
1a4d82fc
JJ
15impl Drop for A {
16 fn drop(&mut self) {
223e47cc 17 }
1a4d82fc
JJ
18}
19
0531ce1d
XL
20extern fn test_middle() {
21 let _a = A;
22 foo();
23}
223e47cc 24
0531ce1d
XL
25fn foo() {
26 let _a = A;
223e47cc 27 unsafe {
0531ce1d 28 test_end();
223e47cc
LB
29 }
30}