FractalFir / rustc_codegen_clr

This rust compiler backend(module) emmits valid CIL (.NET IR), enabling you to use Rust in .NET projects.
MIT License
1.39k stars 30 forks source link

Assorted arithmetic intrinsics tests #50

Closed Oneirical closed 1 month ago

Oneirical commented 1 month ago

Part of #45. Please check off the appropriate tickboxes in the issue if this gets merged.

FractalFir commented 1 month ago

Some of the tests you provided are failing to compile, because the tests are run in a no_std environment.

error[E0599]: no method named `abs` found for type `f32` in the current scope
  --> ./trigonometry.rs:21:44
   |
21 |     let abs_difference = (cosf32(x) - 1.0).abs();
   |                  

Also, the test macro is roughly equivalent to assert. So, something like this:

  test!(fabsf64(f64::NAN.is_nan()));

is not going to work. Perhaps you meant to write

  test!(fabsf64(f64::NAN).is_nan());

instead?

Oneirical commented 1 month ago

Some of the tests you provided are failing to compile, because the tests are run in a no_std environment.

Right, writing code in a no_std environment is a habit to develop. I'll push a fix tomorrow.