Skip to content

Commit a350bea

Browse files
committed
Fix linker problem in issue 2214 test case
1 parent 312faf3 commit a350bea

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

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

0 commit comments

Comments
 (0)