Skip to content

Commit 290206b

Browse files
committed
Add test for issue 2214
1 parent 2a53640 commit 290206b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/run-pass/issue-2214.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import libc::{c_double, c_int};
2+
3+
fn lgamma(n: c_double, value: &mut int) -> c_double {
4+
ret m::lgamma(n, value as &mut c_int);
5+
}
6+
7+
#[link_name = "m"]
8+
#[abi = "cdecl"]
9+
native mod m {
10+
#[link_name="lgamma_r"] fn lgamma(n: c_double, sign: &mut c_int)
11+
-> c_double;
12+
}
13+
14+
fn main() {
15+
let mut y: int = 5;
16+
let x: &mut int = &mut y;
17+
assert (lgamma(1.0 as c_double, x) == 42.0 as c_double);
18+
}

0 commit comments

Comments
 (0)