MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / cast_nested_byte_composition_reads_u64

Function cast_nested_byte_composition_reads_u64

tests/integration/vm_execution.rs:2559–2600  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2557 r#"
2558main: () -> i32 {
2559 a: f64 = 5.0
2560 eight: f64 = 8.0
2561 b: f64 = -a
2562 c: f64 = b + eight
2563 return c as i32
2564}
2565"#,
2566 );
2567 assert!(
2568 matches!(outcome, RunOutcome::Halted(3)),
2569 "expected Halted(3), got {outcome:?}"
2570 );
2571}
2572
2573#[test]
2574fn float_f32_comparison() {
2575 // f32 less-than comparison must use flt.s.
2576 let (_, outcome, _) = run_hll(
2577 r#"
2578main: () -> i32 {
2579 a: f32 = 1.5
2580 b: f32 = 2.5
2581 if a < b {
2582 return 1
2583 }
2584 return 0
2585}
2586"#,
2587 );
2588 assert!(
2589 matches!(outcome, RunOutcome::Halted(1)),
2590 "expected Halted(1), got {outcome:?}"
2591 );
2592}
2593
2594#[test]
2595fn float_f64_comparison() {
2596 // f64 equality must use feq.d (not the integer comparator).
2597 let (_, outcome, _) = run_hll(
2598 r#"
2599main: () -> i32 {
2600 a: f64 = 5.5
2601 b: f64 = 2.5
2602 eight: f64 = 8.0
2603 c: f64 = a + b

Callers

nothing calls this directly

Calls 1

run_hllFunction · 0.70

Tested by

no test coverage detected