From a6044b4a4d38354411cbf535472776f4d5bb30d5 Mon Sep 17 00:00:00 2001 From: varobert Date: Wed, 2 May 2012 07:44:19 +0000 Subject: Fixed float comparison in checklink git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1882 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- checklink/Check.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'checklink/Check.ml') diff --git a/checklink/Check.ml b/checklink/Check.ml index 7dcdc83..9282f5e 100644 --- a/checklink/Check.ml +++ b/checklink/Check.ml @@ -318,8 +318,11 @@ let match_ints: int -> int -> f_framework -> f_framework = check_eq "match_ints" let match_int32s: int32 -> int32 -> f_framework -> f_framework = check_eq "match_int32s" -let match_floats: float -> float -> f_framework -> f_framework = - check_eq "match_floats" +(** We compare floats by their bit representation, so that 0.0 and -0.0 are + different. *) +let match_floats (a: float) (b: float): f_framework -> f_framework = + check_eq "match_floats" (Int64.bits_of_float a) (Int64.bits_of_float b) + let match_crbits cb eb = check_eq "match_crbits" cb (crbit_arr.(eb)) let match_iregs cr er = check_eq "match_iregs" cr (ireg_arr.(er)) let match_fregs cr er = check_eq "match_fregs" cr (freg_arr.(er)) -- cgit v1.2.3