From 59e3fd6c2c4c840dcc8323e0beb02d2a11b2c66f Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 13 Jul 1987 16:50:57 +0000 Subject: [PATCH] Added NOFL to Makefile, to pass NOFLOAT. Also improved the clean entry --- lang/pc/test/Makefile | 36 +++++++++++++++++++----------------- lang/pc/test/callc.p | 13 ++++++++++++- lang/pc/test/cmod.c | 4 ++++ 3 files changed, 35 insertions(+), 18 deletions(-) diff --git a/lang/pc/test/Makefile b/lang/pc/test/Makefile index 23dedb7cc..b3d3c828a 100644 --- a/lang/pc/test/Makefile +++ b/lang/pc/test/Makefile @@ -1,33 +1,35 @@ # $Header$ +NOFL = + all: testC testI testI: -# int t1.p; em - int t2.p; em - int t3.p; em e.out f1 f2 f3 f4 f5 f6 - int t4.p; em - int t5.p; em - int tstenc.p; em - int tstgto.p; em - int -.p callc.p cmod.c ; em +# int $(NOFL) t1.p; em + int $(NOFL) t2.p; em + int $(NOFL) t3.p; em e.out f1 f2 f3 f4 f5 f6 + int $(NOFL) t4.p; em + int $(NOFL) t5.p; em + int $(NOFL) tstenc.p; em + int $(NOFL) tstgto.p; em + int $(NOFL) -.p callc.p cmod.c ; em rm -f e.out f? *.k testC: - apc t1.p; a.out - apc t2.p; a.out - apc t3.p; a.out f1 f2 f3 f4 f5 f6 - apc t4.p; a.out - apc t5.p; a.out - apc tstenc.p; a.out - apc tstgto.p; a.out - apc -.p callc.p cmod.c ; a.out + apc $(NOFL) t1.p; a.out + apc $(NOFL) t2.p; a.out + apc $(NOFL) t3.p; a.out f1 f2 f3 f4 f5 f6 + apc $(NOFL) t4.p; a.out + apc $(NOFL) t5.p; a.out + apc $(NOFL) tstenc.p; a.out + apc $(NOFL) tstgto.p; a.out + apc $(NOFL) -.p callc.p cmod.c ; a.out rm -f a.out f? *.[os] install cmp: clean: - -rm -f [ea].out f? + -rm -f [ea].out f? *.o opr: make pr | opr diff --git a/lang/pc/test/callc.p b/lang/pc/test/callc.p index 003b008da..0c24c4747 100644 --- a/lang/pc/test/callc.p +++ b/lang/pc/test/callc.p @@ -1,3 +1,4 @@ +# program callc(input,output) ; var success: integer ; procedure rcsid ; begin writeln('$Header$') end ; @@ -5,6 +6,7 @@ function kwad(val:integer) : integer ; extern ; procedure cmain ; extern ; procedure incs ; begin success:=success+1 end ; procedure pptr( function ptwice(val:integer):integer ) ; extern ; +#ifndef NOFLOAT function ceval( function pinside(val:integer):real ): boolean ; extern ; function outside(val:integer):real ; begin @@ -25,6 +27,7 @@ begin if ceval(outside) then success:=success+1 else writeln('Calling outside through C doesn''t work') end; +#endif procedure cptr( function pkwad(val:integer):integer ) ; begin if ( pkwad(-2)<>4 ) and (pkwad(-8)<>64) then @@ -44,7 +47,15 @@ begin success:=success+1 ; cmain; pptr(twice) ; +#ifndef NOFLOAT envellop ; - if success <>7 then writeln('Only ',success,' tests passed') +#endif + if success <> +#ifdef NOFLOAT + 4 +#else + 7 +#endif + then writeln('Only ',success,' tests passed') else writeln('All tests passed') end. diff --git a/lang/pc/test/cmod.c b/lang/pc/test/cmod.c index 6e5841e4d..8c6b92721 100644 --- a/lang/pc/test/cmod.c +++ b/lang/pc/test/cmod.c @@ -10,10 +10,12 @@ typedef struct { char *p_slink ; } p_fiptr ; +#ifndef NOFLOAT typedef struct { double (*p_func)() ; char *p_slink ; } p_ffptr ; +#endif int kwad(val) int val ; { return val*val ; } cmain() { @@ -43,6 +45,7 @@ pptr(p_twice) p_fiptr p_twice ; { else incs() ; } +#ifndef NOFLOAT double callpas(pasfunc,par) p_ffptr pasfunc ; int par ; { /* Call a Pascal function, both inner block and outer block */ /* Function must return a double, (In pascal terms: real) */ @@ -60,3 +63,4 @@ int ceval(p_inside) p_ffptr p_inside ; { resval= callpas(p_inside,2) ; return resval>1.41 && resval<1.42 ; } +#endif