mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-27 15:24:00 +00:00
Branches: main Support unboxed float fields in high-level C grades. When the representation of `float' is no wider than a machine word, d.u. functor arguments of type `float' (or equivalent) will be stored directly within cells constructed for that functor, instead of a pointer to the box containing the value. This was already so for low-level C grades. compiler/mlds.m: Add an option to mlds_type, equivalent to `mlds_array_type(mlds_generic_type)' except that some elements are known to be floats. Update some comments. compiler/ml_global_data.m: Remember the `--unboxed-float' option in `ml_global_data'. Special case generic arrays in `ml_gen_static_scalar_const_addr' and `ml_gen_static_scalar_const_value'. Float literals cannot be used to initialize an element of a generic array in C. If any appear, replace the generic array type by an instance of `mlds_mostly_generic_array_type' with float fields in the positions which have float initializers. compiler/ml_code_util.m: Make `ml_must_box_field_type' and `ml_gen_box_const_rval' depend on the `--unboxed-float' option. Delete some now-misleading comments. Delete an unused predicate. compiler/mlds_to_c.m: Update code that writes out scalar static data to handle `mlds_mostly_generic_array_type'. In one case, for `--high-level-data' only, output float constants by their integer representation, so that they may be cast to pointer types. compiler/ml_unify_gen.m: Rename some predicates for clarity. compiler/ml_accurate_gc.m: compiler/ml_lookup_switch.m: compiler/ml_proc_gen.m: compiler/ml_simplify_switch.m: compiler/mlds_to_cs.m: compiler/mlds_to_gcc.m: compiler/mlds_to_il.m: compiler/mlds_to_java.m: Conform to changes. library/float.m: Add hidden functions to return the integer representation of the bit layout of floating point values. library/exception.m: Delete mention of MR_AVOID_MACROS. runtime/mercury.c: runtime/mercury.h: Make MR_box_float/MR_unbox_float act like "casts" when MR_BOXED_FLOAT is undefined, and only define them in high-level grades. I think they should be replaced by MR_float_to_word/MR_word_to_float (which have less confusing names when there is no boxing) but that would require some header file reshuffling which I don't want to undertake yet. Delete references to MR_AVOID_MACROS. Apparently it existed to support the defunct gcc back-end but I cannot see it ever being defined. runtime/mercury_conf_param.h: MR_HIGHLEVEL_CODE no longer implies MR_BOXED_FLOAT. Delete mention of MR_AVOID_MACROS. runtime/mercury_float.h: Fix a comment. tests/hard_coded/Mmakefile: tests/hard_coded/float_ground_term.exp: tests/hard_coded/float_ground_term.m: Add a test case.
The Mercury test suite is (dis)organized into a directory hierarchy.
`mmake' will run the tests in the directory it is
invoked in and all subdirectories of that subdirectory.
Use `mmake runtests_local' to just run the local tests without
the subdirectories.
To run just the tests that failed in a previous test run,
use `mmake ERROR_FILE=FILE', where FILE is a copy of the
runtests.errs file from the previous run.
Both the bootcheck script and the nightly script use `mmake'
to run all the tests.
Unless otherwise stated, the tests in each directory compile
the test programs and compare their output against hand-coded
`.exp' (or `.exp2', `.exp3', etc) files.
NOTE: if you add a new (sub)directory to the test suite then you
may need to update the value of the variable `all_test_dirs'
in tools/bootcheck.
analysis
This directory is for testing the intermodule analysis framework.
benchmarks
This directory contains Mercury versions of the benchmarks.
debugger
This directory is for testing mdb, the Mercury debugger.
Programs are compiled with deep tracing turned on. The
tests in this directory are not performed if the base grade
is `jump' or `fast'.
debugger/declarative
This directory is for testing the declarative debugging
features of mdb.
general
hard_coded
These directories are for general test cases.
(It might be a good idea to split this into tests
of particular features and regression tests that check
for old bugs. But for the moment, just about everything
goes in here.)
The historical reason for the separate `general' and `hard_coded'
directories was that the tests in `general' worked with NU-Prolog
and compared the Mercury output with the NU-Prolog output,
but the tests in `hard_coded' didn't work with NU-Prolog, so
their expected output needed to be hard-coded. We no longer
support compilation with NU-Prolog, so everything goes
in hard_coded now.
recompilation
This directory contains tests of the smart recompilation system.
As well as checking for the correct output from the test
programs these tests also examine the `.err' files to
make sure that all necessary recompilations are performed.
valid
This directory is for test cases that are not complete
programs. We just check that the files compile.
invalid
This directory is for test cases that are invalid
programs. We check that the files do *not* compile,
and check that the errors match those in the hand-written
`.err_exp' file.
warnings
This directory is for tests of compiler warnings. These work by
comparing the warnings emitted by the compiler with those given
in the hand-written `.exp' file.
term
This directory tests the compiler's termination analyser. These
tests work by comparing the contents of the .trans_opt file emitted
by the compiler with the hand-written `.trans_opt_exp' file.
This directory is also used for testing the compiler's exception
analysis.
trailing
This directory contains tests that make use of the trail.
These tests are only run in trailing grades.