diff options
-rw-r--r-- | tests/cmath.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/cmath.rs b/tests/cmath.rs new file mode 100644 index 00000000..477184b7 --- /dev/null +++ b/tests/cmath.rs @@ -0,0 +1,20 @@ +#![feature(phase)] + +#[phase(plugin)] +extern crate bindgen; + +#[allow(dead_code)] +#[allow(non_snake_case)] +#[allow(non_camel_case_types)] +#[allow(non_upper_case_globals)] +pub mod ffi { + bindgen!("math.h", link = "m") +} + +fn main() { + unsafe { + assert_eq!(ffi::floor( 2.7), 2.0); + assert_eq!(ffi::floor(-2.7), -3.0); + assert_eq!(ffi::floor(-0.0), 0.0); + } +} |