62 lines
		
	
	
	
		
			2.6 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
	
		
			2.6 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
To run this test, set the CEM variable to the compilation command,
 | 
						|
and the RUN variable to the run command (name of the interpreter or empty).
 | 
						|
For instance:
 | 
						|
 | 
						|
	CEM="acc -mem24"; export CEM
 | 
						|
	RUN=em; export RUN
 | 
						|
 | 
						|
Then type: sh run > out 2>&1 &
 | 
						|
 | 
						|
The test are subdivided into several directories.
 | 
						|
Only the directory ctgen contains more than one program, but it
 | 
						|
is an exception anyhow.
 | 
						|
All other directories contain one program, say test.c.
 | 
						|
It is translated with a file test.cem as result.
 | 
						|
This test is run, producing output on test.cem.r.
 | 
						|
The 'expected' output is distributed on files named test.cem.g.
 | 
						|
The run files in these directories use the makefile in this
 | 
						|
directory to create the ...cem, ....cem.r files.
 | 
						|
After creating the ....cem.r files a diff is run between the .r
 | 
						|
and .g files. The output of these diffs is preceded by the line
 | 
						|
comparing ....cem
 | 
						|
Not all differences are caused by errors.
 | 
						|
Part of the output in the subdirectory ctmargt is a printout
 | 
						|
of the current environment variables. These will differ per
 | 
						|
user.
 | 
						|
The expected output in the directory ctconv is for a compiler
 | 
						|
that considers char's as signed quantities.
 | 
						|
The expected output in all directories is generated using
 | 
						|
32-bit arithmetic. Using 16-bit arithmetic will cause several
 | 
						|
discrepancies to occur with the expected output in the ...cem.g
 | 
						|
files.
 | 
						|
 | 
						|
The output of a run with a compiler using 2-bytes int can be found
 | 
						|
in the file Out2.std.
 | 
						|
 | 
						|
If any other differences with the expected output occur, the error
 | 
						|
causing the diffence has to be rooted out by a person with some
 | 
						|
experience with the kit. Most errors will be caused by the
 | 
						|
backend programs, so looking at the assembly code generated by
 | 
						|
such a backend from EM code is a good strategy when looking for
 | 
						|
a cause.
 | 
						|
 | 
						|
The programs in the directory ctgen are structured somewhat
 | 
						|
differently. This directory contains a file 'OPS' with a
 | 
						|
prototype program. This prototype program performs all C
 | 
						|
arithmetic operations on a few operands. The operands are
 | 
						|
X, Y, S, Z1, Z2. X, Y and S can be arbitrary expressions,
 | 
						|
but S is used as a shift count and must be less then 32 (16).
 | 
						|
Z1 and Z2 must be lvalue's.
 | 
						|
The name ISTART indicates global declarations and LSTART
 | 
						|
indicates local declarations.
 | 
						|
The files ....sed (e.g. test.sed) are used
 | 
						|
to produce legal C programs from the OPS file, in which
 | 
						|
the result of all expressions is printed.
 | 
						|
The programs are run in the way described above.
 | 
						|
 | 
						|
If one has a implementation without floating point one can
 | 
						|
use the -DNOFLOAT flag.
 | 
						|
Most programs use compile time #ifdef's to hide the use of
 | 
						|
floating point they make.
 | 
						|
Differences are to be expected in the output of such a run.
 | 
						|
Look at the file Out2.nf.std or Out4.nf.std to see what can be expected.
 |