Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/t27b/tests/tail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ fn a_comptime_int_rounds_in_float_from_int() {

/// #7819: of an f32 they call libm.t27's ports of compiler_rt (`roundf` half away from zero, `fmodf` signed as the
/// dividend), and `@rem`'s second operand takes the first one's type (specs/tri/t27b/libm_plan.t27). An f64 is refused
/// but by `@round` (#7923), so the first refusal there is `@floor`'s.
/// but by `@round` (#7923), `@floor` and `@ceil` (#10405), so the first refusal there is `@trunc`'s.
#[test]
fn f32_rounding_and_rem_call_their_ports() {
let src = "module a;\n\nfn f(x: f32) -> f32 {\n return @round(x) + @floor(x) + @ceil(x) + @trunc(x) + @rem(x, 2.0);\n}\n\ntest t {\n assert(f(-2.5) == -10.5);\n}\n";
assert_eq!(names_ok(&run(src)), vec![("t", false, true)]);
for (from, to, what, why) in [("x: f32) -> f32", "x: f64) -> f64", "@floor", "no f64 routine"), ("@rem(x, 2.0)", "@rem(x)", "@rem", "`@rem` two")] {
for (from, to, what, why) in [("x: f32) -> f32", "x: f64) -> f64", "@trunc", "no f64 routine"), ("@rem(x, 2.0)", "@rem(x)", "@rem", "`@rem` two")] {
let m = rejected(&src.replace(from, to));
assert!(m.contains(&format!("construct ExprCall({}) at line 4", what)) && m.contains(why), "{}", m);
}
Expand Down
Loading