mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-24 17:04:19 +00:00
Upload
Digital Research
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
c68 -S test.c
|
||||
as68 -u -p test.s > test.asmlist
|
||||
@@ -0,0 +1,2 @@
|
||||
$ set def [steve.cpm68k.c.ctest]
|
||||
$ diff test.asm test.src
|
||||
@@ -0,0 +1,60 @@
|
||||
#include <math.h>
|
||||
|
||||
float *f1();
|
||||
float f2();
|
||||
|
||||
struct type {
|
||||
float ft;
|
||||
double dt;
|
||||
float *pft;
|
||||
} fstruc;
|
||||
|
||||
char *fstr = "-2.3E-4";
|
||||
char *astr = "8.6324";
|
||||
|
||||
main()
|
||||
{
|
||||
double d;
|
||||
float f, *fp;
|
||||
char *s, buf[20];
|
||||
long l;
|
||||
int i;
|
||||
|
||||
if ((fp = f1()) != fstruc.pft) error(0xf1);
|
||||
if ((f = f2()) != 2.0) error(0xf2);
|
||||
d = f;
|
||||
if (d != f) error(0xf3);
|
||||
f = atof(fstr);
|
||||
s = ftoa(f,buf,6);
|
||||
if (strcmp(s,"-0.000230") != 0) error(0xf4);
|
||||
f = 3.4;
|
||||
l = f;
|
||||
if (l != 3L) error(0xf5);
|
||||
i = f;
|
||||
if (i != 3) error(0xf6);
|
||||
f = l;
|
||||
if (f < 3.0) error(0xf7);
|
||||
f = i;
|
||||
if (f < 3.0) error(0xf8);
|
||||
f = atof(astr);
|
||||
printf("%s ==> ~ %f or %e\n",astr,f,f);
|
||||
printf("Far Freaking Out....\n");
|
||||
}
|
||||
|
||||
float *
|
||||
f1()
|
||||
{
|
||||
return(fstruc.pft);
|
||||
}
|
||||
|
||||
float
|
||||
f2()
|
||||
{
|
||||
return(2.0);
|
||||
}
|
||||
|
||||
error(enum)
|
||||
int enum;
|
||||
{
|
||||
printf("%x\n",enum);
|
||||
}
|
||||
1104
CPM OPERATING SYSTEMS/CPM 68K/1.0X SOURCES/v101/c/ctest/test.c
Normal file
1104
CPM OPERATING SYSTEMS/CPM 68K/1.0X SOURCES/v101/c/ctest/test.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
#define test2x
|
||||
Reference in New Issue
Block a user