Add test for issue 2214
This commit is contained in:
parent
2a53640aa1
commit
290206b178
1 changed files with 18 additions and 0 deletions
18
src/test/run-pass/issue-2214.rs
Normal file
18
src/test/run-pass/issue-2214.rs
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import libc::{c_double, c_int};
|
||||||
|
|
||||||
|
fn lgamma(n: c_double, value: &mut int) -> c_double {
|
||||||
|
ret m::lgamma(n, value as &mut c_int);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[link_name = "m"]
|
||||||
|
#[abi = "cdecl"]
|
||||||
|
native mod m {
|
||||||
|
#[link_name="lgamma_r"] fn lgamma(n: c_double, sign: &mut c_int)
|
||||||
|
-> c_double;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let mut y: int = 5;
|
||||||
|
let x: &mut int = &mut y;
|
||||||
|
assert (lgamma(1.0 as c_double, x) == 42.0 as c_double);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue