if(`int=©4294967296) wordsizeû64 else wordsizeû32;


tû0 12 100Î¢100+÷2396527.0-600.0«É5
if (~(100Ât)½(100Â`int©t)) {
  Õ'>>ERROR<<: Â';
} else {
  Õ"Passed: Â test";
}

if(wordsize=32) {
   t1û1147483648;
   t2û2294967296;
} else { 
   t1û10000000000000000000;
   t2û2e+19;
}

bpwûwordsizeß8;
xû`int ©® ((bpw-1)Ò`char©0),`char©1
if (x¨1) {
  xû`int ©® (`char©1),(bpw-1)Ò`char©0;
}
if (x¨1) {
  Õ">>ERROR<< bitwise cast";
} else {
  Õ"Passed: bitwise cast test";
}

if ((2«t1) ¨ t2) {
  Õ">>ERROR<< ovli";
} else {
  Õ"Passed: ovli test";
}

if ('0'¨1î0.5) {
  Õ">>ERROR<< doprnt";
} else {
  Õ"Passed: doprnt test";
}

if (~(` `x)½Ö`x) {
  Õ">>ERROR<< dot";
} else {
  Õ"Passed: dot test";
}

xû1.0 ¢1 0.0 0.0 0.0 0.0;
if (0=Ä/x) {
  Õ">>ERROR<< libhpc/FloatMin (fix:cwm 11/10/95)";
} else {
  Õ"Passed: libhpc/FloatMin test";
}

`corelim _ssv Inf;
if (Inf ¨ ÓInf) {
  Õ">>ERROR<< ÓInf (see cli/fli)";
} else {
  Õ"Passed: ÓInf test";
}

if (1 ¨ +/1) {
  Õ">>ERROR<< ovli 32bit";
} else {
  Õ"Passed: ovli 32bit";
}

if(wordsize=32) {
   t1û4294967296;
   t2û65536 65536; 
} else {  
   t1û1e+24;
   t2û1000000000000 1000000000000;
}


if (t1 ¨ «/t2) {
  Õ">>ERROR<< «/ ovli";
} else {
  Õ"Passed:  «/ ovli";
}

evûÉ0;
rû(,0)½Ò`int©>#¡ev;
if(r) rû(,0)½Ò`int©>#¡ev;
if(r) rû(,0)½Ò`int©>#¡ev;
if(r) rû(,0)½Ò`int©>#¡ev;
if (~r) {
  Õ">>ERROR<< jfs cast bug";
} else {
  Õ"Passed: jfs cast bug";
}

if (Inf ¨ ðInf) {
  Õ">>ERROR<< FPE code";
} else {
  Õ"Passed: FPE code";
}

if (9 ¨ 0Ødo¢2ð.5) {
  Õ">>ERROR<< no NaN check";
} else {
  Õ"Passed: NaN test ¢2ð.5";
}

if (9 = 0Ødo¢1*3) {
  Õ">>ERROR<< ¢1*3 ultra/vlog_";
} else {
  Õ"Passed: ¢1*3";
}

if (9 ¨ 0Ødo 0ß0) {
  Õ">>ERROR<< no FPE check";
} else {
  Õ"Passed: FPE check 0ß0 ";
}

if (~0 1½èInf Inf) {
  Õ">>ERROR<< No NaN/Inf for èInf Inf";
} else {
  Õ"Passed: èInf Inf";
}

if (9 ¨ 0Ødo `int©2*wordsize) {
  Õ">>ERROR<< `int©2*",(1Õîwordsize)," NOT a domain error";
} else {
  Õ"Passed: `int©2*",(1Õîwordsize)," results in a domain error";
}

if (4 8 16 ½ 2*3 4) {
  Õ">>ERROR<< exp()/NaN";
} else {
  Õ"Passed: exp()/NaN 2*3 4";
}

if (8 ¨ *3«ð2) {
  Õ">>ERROR<< isnan()";
} else {
  Õ"Passed: NaN check *3«ð2";
}

if (~¢Inf ¢Inf ¢Inf ¢Inf½ð0 0 0 0) {
  Õ">>ERROR<< ð0 0 0 0";
}

fnû"/tmp/a+_fsftest.",1Õsys.getpid{}
fdûsys.open{fn;`O_CREAT`O_RDWR;438}
if (fd < 0) {
  Õ">>ERROR<< failed sys.open{",fn,"`O_CREAT`O_RDWR; 8 8 8 Â 6 6 6}";
} else {
  if(0¨sys.flock{fd;`LOCK_EX`LOCK_NB}) {
    Õ">>ERROR<< flock{fd;`LOCK_EX`LOCK_NB}";
  } else {
    Õ"Passed: flock{fd;`LOCK_EX`LOCK_NB}";
    if(0¨sys.flock{fd;`LOCK_UN}) {
      Õ">>ERROR<< flock{fd;`LOCK_UN}";
    } else {
      Õ"Passed: flock{fd;`LOCK_UN}";
    };
  };
  sys.unlink{fn};
}

Õ"Testing klewis bug: segv is a fail, a comment or number is a pass";
aûÉ10 10
$|a cat >/dev/null
$wa

tsû6Ùsys.ts{};
if(~ts½6Ùsys.ts1 sys.mkts1 ts,0) {
  Õ">>ERROR<< sys.ts1{}";
} else {
  Õ"Passed: sys.ts1{}";
}

tû19970408 19970328 19970331 19970401 19970402 19970403 19970404 19970407
if((Ä/`float©t)¨`float©19970328) {
  Õ">>ERROR<< acc bug";
} else {
  Õ"Passed: acc not used";
}

aû`aLoooooooooooooooooooooooooooooooooooooooooooooooooooooooongNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaame;
bûîa;
1+1;
Õ"Passed: long symbol test";

xû0.01«?1000Ò100
Õ"Passed: ",îtime 1000 do * x;

xû2?16 ã will segv if broken
Õ"Passed: askom CDROM deal corruption";

if (~(É5) ½ 1.0 2.0 3.0 4.0 5.0 É 1.0 2.0 3.0 4.0 5.0) {
  Õ">>ERROR<< gcc optimization issue in i.c (johns)";
} else {
  Õ"Passed: gcc optimization challenge (johns)";
}

ã Last Test
Õ"Testing timers...(will fire in 1 second and print finished message)";
tf{h;a;d}:{
  n2ûsys.gettod{0}-.n;
  if ((+/1000000 1«n2)) {
    Õ"";
    Õ"Passed: timer SetTimer";
  };
  Õ"!!FINISHED!!";
  sys.exit 0;
}
nûsys.gettod 0;
adap.SetTimer{`foo;tf;1};
