mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
Estimated hours taken: 4 compiler/frameopt: Bug fix: make sure that the transformation that keeps stack frames put the instruction that restores succip before a livevals/goto pair. It used to put it in between the livevals and the goto, which violates an invariant that value numbering depends on. compiler/vn_table: Allow the two operands of an operator to be the same. compiler/vn_util: Add simplification rules for dealing with boolean and and or, and rules exploiting the identities of several operators. tests/hard_coded/float_map: A test case for the fix to builtin_float_compare recently checked in by Fergus. tests/hard_coded/Mmake: Enable the new test case. tests/valid/livevals_seq: A new test case for the fix to frameopt. tests/valid/double_vn: A new test case for the fix to vn_table. tests/valid/Mmake: Enable the new test cases.
23 lines
493 B
Mathematica
23 lines
493 B
Mathematica
% This is a regression test. Some versions of the compiler fail it
|
|
% because of an improper implementation of comparison for floats.
|
|
|
|
:- module float_map.
|
|
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module map, float.
|
|
|
|
main(S0, S) :-
|
|
map__init(M1),
|
|
map__det_insert(M1, 1.0, 5, M2),
|
|
( map__search(M2, 14.5, _) ->
|
|
io__write_string("found it: bug\n", S0, S)
|
|
;
|
|
io__write_string("did not find it: ok\n", S0, S)
|
|
).
|