diff options
author | varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-05-02 07:44:19 +0000 |
---|---|---|
committer | varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-05-02 07:44:19 +0000 |
commit | a6044b4a4d38354411cbf535472776f4d5bb30d5 (patch) | |
tree | a80d8cd8948b55dfd7355ffd0fb662399449ad09 /checklink | |
parent | 2829523d71dfe92c1adc9cf59851639e895ae996 (diff) |
Fixed float comparison in checklink
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1882 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'checklink')
-rw-r--r-- | checklink/Check.ml | 7 |
1 files changed, 5 insertions, 2 deletions
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)) |