Pristine Ack-5.5
[Ack-5.5.git] / lang / cem / ctest / READ_ME
1 To run this test, set the CEM variable to the compilation command,
2 and the RUN variable to the run command (name of the interpreter or empty).
3 For instance:
4
5         CEM="acc -mem24"; export CEM
6         RUN=em; export RUN
7
8 Then type: sh run > out 2>&1 &
9
10 The test are subdivided into several directories.
11 Only the directory ctgen contains more than one program, but it
12 is an exception anyhow.
13 All other directories contain one program, say test.c.
14 It is translated with a file test.cem as result.
15 This test is run, producing output on test.cem.r.
16 The 'expected' output is distributed on files named test.cem.g.
17 The run files in these directories use the makefile in this
18 directory to create the ...cem, ....cem.r files.
19 After creating the ....cem.r files a diff is run between the .r
20 and .g files. The output of these diffs is preceded by the line
21 comparing ....cem
22 Not all differences are caused by errors.
23 Part of the output in the subdirectory ctmargt is a printout
24 of the current environment variables. These will differ per
25 user.
26 The expected output in the directory ctconv is for a compiler
27 that considers char's as signed quantities.
28 The expected output in all directories is generated using
29 32-bit arithmetic. Using 16-bit arithmetic will cause several
30 discrepancies to occur with the expected output in the ...cem.g
31 files.
32
33 The output of a run with a compiler using 2-bytes int can be found
34 in the file Out2.std.
35
36 If any other differences with the expected output occur, the error
37 causing the diffence has to be rooted out by a person with some
38 experience with the kit. Most errors will be caused by the
39 backend programs, so looking at the assembly code generated by
40 such a backend from EM code is a good strategy when looking for
41 a cause.
42
43 The programs in the directory ctgen are structured somewhat
44 differently. This directory contains a file 'OPS' with a
45 prototype program. This prototype program performs all C
46 arithmetic operations on a few operands. The operands are
47 X, Y, S, Z1, Z2. X, Y and S can be arbitrary expressions,
48 but S is used as a shift count and must be less then 32 (16).
49 Z1 and Z2 must be lvalue's.
50 The name ISTART indicates global declarations and LSTART
51 indicates local declarations.
52 The files ....sed (e.g. test.sed) are used
53 to produce legal C programs from the OPS file, in which
54 the result of all expressions is printed.
55 The programs are run in the way described above.
56
57 If one has a implementation without floating point one can
58 use the -DNOFLOAT flag.
59 Most programs use compile time #ifdef's to hide the use of
60 floating point they make.
61 Differences are to be expected in the output of such a run.
62 Look at the file Out2.nf.std or Out4.nf.std to see what can be expected.