Skip to content

Commit 99906c4

Browse files
felixL-Kfilipeom
authored andcommitted
adding test for x<y !=> not(x>=y)
1 parent 50229da commit 99906c4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/unit/test_expr.ml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,13 +614,24 @@ let test_simplify_concat_i32_symbol _ =
614614
let concated = Expr.concat d (Expr.concat c (Expr.concat b a)) in
615615
check concated x
616616

617+
let test_fp_nan_not_geffects _ =
618+
let open Infix in
619+
let ty = Ty.Ty_fp 32 in
620+
let x = symbol "x" ty in
621+
let y = symbol "y" ty in
622+
(* x != x makes isNaN(x) *)
623+
let expr = Expr.unop ty Not (Expr.relop ty Ge x y) in
624+
let expected = Expr.unop ty Not (Expr.relop ty Le y x) in
625+
check expr expected
626+
617627
let test_simplify_concat =
618628
[ "test_simplify_concat_i32_i32" >:: test_simplify_concat_i32_i32
619629
; "test_simplify_concat_i32_symbol" >:: test_simplify_concat_i32_symbol
620630
]
621631

622632
let test_simplify =
623633
[ "test_simplify_assoc" >:: test_simplify_assoc
634+
; "test_fp_nan_not_geffects" >:: test_fp_nan_not_geffects
624635
; "test_simplify_extract" >::: test_simplify_extract
625636
; "test_simplify_concat" >::: test_simplify_concat
626637
]

0 commit comments

Comments
 (0)