|
|
Power 6/32 Unix version 1.2b
/* For error reporting
*/
long test_no;
long subtst;
long ercode;
long actual;
long expected;
long stpc;
long no_opr;
long opr[4];
long error_cnt;
/* For looping
*/
long cycle;
long forever;
long force_lp, scoplp;
/* For messages
*/
long display;
long heading;
long op_mode; /* 1 : Tahoe, 0 : CP */
/* Counters
*/
long prog_cnt;
long test_cnt;
extern struct TEST_TBL {
short run;
short loop;
char *name;
} test_tbl[];
M_error()
{
if (op_mode == 1) tahoe_err();
else /* Gives everythings to CP */
cp_err();
}
tahoe_err()
{ register long dummy;
if (display) disp_err();
if (forever && !display) scoplp = 1;
if (forever) {
force_lp = 1; /* Checked in each subtest */
longjmp();
}
dummy =1;
asm("halt");
}
disp_err()
{ long ix;
writes("\n ** Test no ("); writeh(test_no); writes(") ");
writes(test_tbl[test_no-1].name);
writes("Subtest "); writed(subtst);
if (ercode==1) writes("\nUnexpected result.");
else if (ercode==2) writes("\nFlag error.");
else if (ercode==3) writes("\nOperand modified.");
writes("\n** Actual "); writeh(actual);
writes(", Expected "); writeh(expected);
for (ix=0;ix<no_opr;ix++) {
writes("\nOperand");writed(ix+1); writes(" ");writeh(opr[ix]);
}
writec('\n');
}
long tname;
cp_err()
{ long dummy;
if (forever) {
force_lp = 1; /* Checked in each subtest */
scoplp = 1;
longjmp();
}
tname = (long)test_tbl[test_no-1].name;
asm("movl _test_no,r0");
asm("movl _stpc,r1");
asm("movl _subtst,r2");
asm("movl _ercode,r3");
asm("movl _actual,r4");
asm("movl _expected,r5");
asm("movl _no_opr,r6");
asm("movl _opr,r7");
asm("movl _opr + 4,r8");
asm("movl _opr + 8,r9");
asm("movl _opr + 12,r10");
asm("movl _tname,r11");
asm("halt");
}
lp_init()
{
/* Clear all vars for looping */
error_cnt=subtst=ercode=actual=expected=stpc=no_opr=0;
opr[0]=opr[1]=opr[2]=opr[3]=0;
}
End()
{
writes("\nTest completed with "); writed(error_cnt);
writes(" errors\n");
}
pr_hd()
{ long ix;
if (heading && op_mode) {
writes(" ** Test no ("); writeh(test_no); writes(") ");
writes(test_tbl[test_no-1].name);
}
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.