From 04e454d3c6f3b643abccd5f27c50e1b289cb04a4 Mon Sep 17 00:00:00 2001 From: em Date: Fri, 15 Feb 1985 14:20:04 +0000 Subject: [PATCH] Added RCS id. Adapted to use the NOFLOAT cpp flag. --- lang/cem/ctest/ctconv/conv.c | 47 ++++- lang/cem/ctest/ctdecl/decl.c | 2 + lang/cem/ctest/ctdivers/ops.c | 2 + lang/cem/ctest/cterr/bugs.c | 6 + lang/cem/ctest/ctest1/test.c | 276 ++++++++++++++++++++---------- lang/cem/ctest/ctest2/t7.c | 2 + lang/cem/ctest/ctest3/test2.c | 2 + lang/cem/ctest/ctest5/test1.c | 175 ++++++++++++------- lang/cem/ctest/ctill/noarg.c | 2 + lang/cem/ctest/ctinit/init.c | 14 ++ lang/cem/ctest/ctmargt/margt.c | 2 + lang/cem/ctest/ctprof/procentry.c | 2 + lang/cem/ctest/ctprof/tp.c | 2 + lang/cem/ctest/ctstruct/str.c | 32 ++-- lang/cem/ctest/ctsys/signal.c | 3 + lang/cem/ctest/ctsys/tfork.c | 2 + 16 files changed, 400 insertions(+), 171 deletions(-) diff --git a/lang/cem/ctest/ctconv/conv.c b/lang/cem/ctest/ctconv/conv.c index 7c948db37..20dcad182 100644 --- a/lang/cem/ctest/ctconv/conv.c +++ b/lang/cem/ctest/ctconv/conv.c @@ -17,13 +17,18 @@ /* Author: E.G. Keizer */ +char rcs_id[] = "$Header$" ; + main() { t1() ; return 0 ; } t1() { - char c ; int i ; long l ; unsigned u ; float f ; + char c ; int i ; long l ; unsigned u ; +#ifndef NOFLOAT + float f ; +#endif /* test conversions */ @@ -31,8 +36,10 @@ t1() { printf("(int) '\\377' = %d\n",(int) '\377') ; printf("(long) -1 = %ld\n",(long) -1 ) ; +#ifndef NOFLOAT printf("(float) 12 = %f\n",(float) 12 ) ; printf("(int) 3.14 = %d\n",(int) 3.14 ) ; +#endif printf("(int) 32767L = %d\n",(int) 32767L ) ; printf("(int) -32768L = %d\n",(int) -32768L ) ; printf("(char) 128L = %d\n",(char) 128L) ; @@ -46,20 +53,35 @@ t1() { i=c ; l=c ; u=c ; +#ifndef NOFLOAT f=c ; - printf("\tchar %5d, int %6d, unsigned %6o, long %11ld, float %f\n",c,i,u,l,f) ; +#endif + printf("\tchar %5d, int %6d, unsigned %6o, long %11ld\n",c,i,u,l) ; +#ifndef NOFLOAT + printf("\t\t\t\t\tfloat %f\n",f) ; +#endif c = -1 ; i=c ; l=c ; u=c ; +#ifndef NOFLOAT f=c ; - printf("\tchar %5d, int %6d, unsigned %6o, long %11ld, float %f\n",c,i,u,l,f) ; +#endif + printf("\tchar %5d, int %6d, unsigned %6o, long %11ld\n",c,i,u,l) ; +#ifndef NOFLOAT + printf("\t\t\t\t\tfloat %f\n",f) ; +#endif c = 0377 ; i=c ; l=c ; u=c ; +#ifndef NOFLOAT f=c ; - printf("\tchar %5d, int %6d, unsigned %6o, long %11ld, float %f\n",c,i,u,l,f) ; +#endif + printf("\tchar %5d, int %6d, unsigned %6o, long %11ld\n",c,i,u,l) ; +#ifndef NOFLOAT + printf("\t\t\t\t\tfloat %f\n",f) ; +#endif /* from integer */ printf("From integer\n") ; @@ -67,18 +89,28 @@ t1() { c=i ; l=i ; u=i ; +#ifndef NOFLOAT f=i ; - printf("\tchar %5d, int %6d, unsigned %6o, long %11ld, float %f\n",c,i,u,l,f) ; - +#endif + printf("\tchar %5d, int %6d, unsigned %6o, long %11ld\n",c,i,u,l) ; +#ifndef NOFLOAT + printf("\t\t\t\t\tfloat %f\n",f) ; +#endif /* from long */ printf("From long\n") ; l = -3 ; c = l ; i = l ; u = l ; +#ifndef NOFLOAT f = l ; - printf("\tchar %5d, int %6d, unsigned %6o, long %11ld, float %f\n",c,i,u,l,f) ; +#endif + printf("\tchar %5d, int %6d, unsigned %6o, long %11ld\n",c,i,u,l) ; +#ifndef NOFLOAT + printf("\t\t\t\t\tfloat %f\n",f) ; +#endif +#ifndef NOFLOAT printf("From float\n") ; f = 121.5 ; c = f ; @@ -100,6 +132,7 @@ t1() { f = 1223432e3 ; l = f ; printf("\tlong %11ld, float %f\n",l,f) ; +#endif /* some special cases */ { diff --git a/lang/cem/ctest/ctdecl/decl.c b/lang/cem/ctest/ctdecl/decl.c index 024f35fb0..275931c70 100644 --- a/lang/cem/ctest/ctdecl/decl.c +++ b/lang/cem/ctest/ctdecl/decl.c @@ -17,6 +17,8 @@ /* Author: E.G. Keizer */ +char rcs_id[] = "$Header$" ; + /* Test a few declaration features */ /* Such as: forward function declarations, diff --git a/lang/cem/ctest/ctdivers/ops.c b/lang/cem/ctest/ctdivers/ops.c index b13d3712a..bfc4e7f86 100644 --- a/lang/cem/ctest/ctdivers/ops.c +++ b/lang/cem/ctest/ctdivers/ops.c @@ -17,6 +17,8 @@ /* Author: E.G. Keizer */ +char rcs_id[] = "$Header$" ; + main() { assnull() ; diff --git a/lang/cem/ctest/cterr/bugs.c b/lang/cem/ctest/cterr/bugs.c index 5d92931a0..959dbbf89 100644 --- a/lang/cem/ctest/cterr/bugs.c +++ b/lang/cem/ctest/cterr/bugs.c @@ -17,6 +17,8 @@ /* Author: E.G. Keizer */ +char rcs_id[] = "$Header$" ; + /* This programs is a collection of derived from small tests develloped for specific bugs/features in the C->EM compiler */ @@ -69,12 +71,16 @@ loc_fa(p1,p2) { con_fold() { set_err("con_fold") ; +#ifndef NOFLOAT con_flo( (1 ? 3 : 4.5), 200, 200, 200 ) ; +#endif con_lo( 4L + 3, 1 ) ; } +#ifndef NOFLOAT con_flo(d) double d ; { if ( d>3.00001 || d<2.99999 ) e(1) ; } +#endif con_lo(l) long l ; { if ( l!=7 ) e(2) ; } diff --git a/lang/cem/ctest/ctest1/test.c b/lang/cem/ctest/ctest1/test.c index f685da17d..4befc9789 100644 --- a/lang/cem/ctest/ctest1/test.c +++ b/lang/cem/ctest/ctest1/test.c @@ -15,11 +15,15 @@ * */ +char rcs_id[] = "$Header$" ; + /* C-compiler test 1 */ /* This program can be used to test C-compilers */ +#ifndef NOFLOAT # define EPSD 1e-6 # define EPSF 1e-6 +#endif /* global counters */ @@ -58,7 +62,9 @@ char *alloc(size) { return(retval) ; } +#ifndef NOFLOAT double fabs(a) double a ; { return( a<0 ? -a : a) ; } +#endif @@ -68,23 +74,29 @@ int i,j,k,l,m; long li,lj,lk,ll,lm; +#ifndef NOFLOAT float xf, yf, zf; double xd, yd, zd; +#endif struct tp2 { char c1; int i,j; +#ifndef NOFLOAT float aaa; double bbb; +#endif } r1, r2; int p, *p1, *p11, **p2, ***p3, ****p4, *****p5; struct tp2 *pp1, *pp2, *pp3; int a1[20]; +#ifndef NOFLOAT float a2[20]; double a3[20]; +#endif main() { @@ -100,7 +112,9 @@ main() test8(); test9(); test10(); +#ifndef NOFLOAT test11(); +#endif printf("End of test program, %d tests completed, %d errors detected\n", tct,ect); return 0 ; @@ -659,110 +673,47 @@ test5() /* testing local long variables */ - -test6() /* real arithmetic */ -{ - double fabs(); - double epsd; - float epsf; - float locxf; - - t = 6; - tct++; - epsf = EPSF; - epsd = EPSD; - xf = 1.50; - yf = 3.00; - zf = 0.10; - xd = 1.50; - yd = 3.00; - zd = 0.10; - if ( fabs(1.0 + 1.0 - 2.0) > epsd ) e(1); - if ( fabs( 1e10-1e10 ) > epsd ) e(2); - if ( fabs( 1.0e+5 * 1.0e+5 - 100e+8 ) > epsd ) e(3); - if ( fabs( 10.0/3.0 * 3.0/10.0 - 100e-2 ) > epsd ) e(4); - if ( 0.0e0 != 0 ) e(5); - if ( fabs( 32767.0 - 32767 ) > epsd ) e(6); - if ( fabs( 1.0+2+5+3.0e0+7.5e+1+140e-1-100.0 ) > epsd ) e(7); - if ( fabs(-1+(-1)+(-1.0)+(-1.0e0)+(-1.0e-0)+(-1e0)+6 ) > epsd ) e(8); - if ( fabs(5.0*yf*zf-xf) > epsf ) e(9); - if ( fabs(5.0*yd*zd-xd) > epsd ) e(10); - if ( fabs(yd*yd - (2.0*xd)*(2.0*xd) ) > epsd ) e(11); - if ( fabs(yf*yf - (2.0*xf)*(2.0*xf) ) > epsf ) e(12); - if ( fabs( yd*yd+zd*zd+2.0*yd*zd-(yd+zd)*(zd+yd) ) > epsf ) e(13); - if ( fabs( yf*yf+zf*zf+2.0*yf*zf-(yf+zf)*(zf+yf) ) > epsf ) e(14); - xf = 1.10; - yf = 1.20; - if ( yd=yd ) e(18); - if ( yd epsd ) e(20); - if ( 1.0 * 3.0 != 3.0 * 1.0 ) e(21); - if ( 1.0 != 1e+0 ) e(22); - if ( 4.5 < 4.4 ) e(23); - if ( -3.4 != -3.4 ) e(24); - if ( 10/3.0 - 10/3.0 != 0.0 ) e(25); - if ( fabs( (1<<0) * (-5.3) + 5.3 ) > epsd ) e(26); - if ( fabs( (1<<3) * 5.0 - 4e+1 ) > epsd ) e(27); - if ( fabs( ((1<<5)>>5) - 1e-0 ) > epsd ) e(28); - if ( fabs ( 00000 * 3.0 ) > epsd ) e(29); - if ( fabs ( 8 * 5.0 - 02 * 02 + 04 / 1.0 -40.0 ) > epsd ) e(30); - if ( fabs ( 'a' / 1.0 - 'a' ) > epsd ) e(31); - if ( fabs ( (!1) * ( 2.0 / -34e-1 ) ) > epsd ) e(32); - if ( fabs ( (01 | 1 | 2) * 4.0 - 12.0 ) > epsd ) e(33); - if ( fabs ( 1.0 * 2.0 * 3.0 * 4.0 * 5.0 - 120.0 ) > epsd ) e(34); - if ( fabs ( 1.0 * 2.0 * (1 | (4>>1)) - 6 ) > epsd ) e(35); - if ( fabs ( ( 0 ^ 0 ^ 0 ^ 0 ) * 0.0 ) > epsd ) e(36); - if ( fabs ( 1.0 * 2.0 * (1 ^ (4>>1)) - 6 ) > epsd ) e(37); - if ( fabs ( (((((-1.0 * (((((-1.0))))) - 1.0 ))))) ) > epsd) e(38); - if ( fabs ( ( 2==3 ) * 3.0 ) > epsd ) e(39); - if ( ( 4 + 3 > 5 ? 3.4 : -5e+3 ) != 3.4 ) e(40); - if ( ( -4 -'a' > 0 ? 3.4 : -5e+3 ) != -5e+3 ) e(41); - locxf = 3.0; - xf = 3.0; - if ( locxf != locxf ) e(42); - if ( locxf != xf ) e(43); - if ( locxf * xf != xf * locxf ) e(44); - if ( fabs ( ((2*3)>>1) / 3.0 - 1.0 ) > epsd ) e(45); - if ( fabs ( 'a' / locxf - 'a' / xf ) > epsd ) e(46); - if ( fabs( xf * locxf - 9.0 ) > epsd ) e(47); - yd = 3.0; - if ( fabs( xf*yd - 9.0) > epsd ) e(48); - if ( yd >= 4 ) e(49); - if ( locxf == 2 ) e(50); -} - - - - -test7() /* global records */ +test6() /* global records */ { +#ifndef NOFLOAT double epsd; float epsf; double fabs(); +#endif - t = 7; + t = 6; tct++; +#ifndef NOFLOAT epsd = EPSD; epsf = EPSF; +#endif r1.c1 = 'x'; r1.i = 40; r1.j = 50; +#ifndef NOFLOAT r1.aaa = 3.0; r1.bbb = 4.0; +#endif r2.c1 = r1.c1; r2.i = 50; r2.j = 40; +#ifndef NOFLOAT r2.aaa = 4.0; r2.bbb = 5.0; - if ( r1.c1 != 'x' || r1.i != 40 || r1.aaa != 3.0 ) e(1); +#endif + if ( r1.c1 != 'x' || r1.i != 40 ) e(1); +#ifndef NOFLOAT + if ( r1.aaa != 3.0 ) e(1); +#endif if ( r1.i != 40 || r2.i != 50 ) e(2); if ( r2.j != 40 || r1.j != 50 ) e(3); if ( (r1.c1 + r2.c1)/2 != 'x' ) e(4); +#ifndef NOFLOAT if ( r1.aaa * r1.aaa + r2.aaa * r2.aaa != r2.bbb * r2.bbb ) e(5); r1.i = r1.j = r2.i = r2.j = 3.0; +#else + r1.i = r1.j = r2.i = r2.j = 3; +#endif if ( r1.i != 3 ) e(6); if ( r1.i * r2.j - 9 ) e(7); r1.i++; @@ -785,11 +736,13 @@ test7() /* global records */ if ( (r1.i | r1.i | r1.i | r1.i | r1.i) != r1.i ) e(21); if ( (r2.j & r1.j & r2.j & r2.i) != (r1.i<<3>>3) ) e(22); r1.j = 1; +#ifndef NOFLOAT r1.aaa = 2.0; if ( fabs ( r1.j * r1.aaa - 2.0 ) > epsd ) e(23); if ( (r1.j << 4) * r1.aaa != (r1.j << 4) * r1.aaa ) e(24); if ( ((r1.j<<6)&r1.j) * r1.aaa ) e(25); if ((r1.j | (r1.j << 1)) * r1.aaa != ((r1.j << 1) ^ r1.j) * r1.aaa) e(26); +#endif r1.i = r1.j = r2.i = r2.j = -2; if ( r1.i > 0 || r1.j >= 0 ) e(27); if ( r1.i != r2.j ) e(28); @@ -799,44 +752,65 @@ test7() /* global records */ if ( (r1.i % r1.j) % r1.i ) e(31); if ( 0 % r2.j ) e(32); if ( 03 * r1.i != -6 ) e(33); +#ifndef NOFLOAT r1.aaa = r2.aaa = -4; r1.bbb = r2.bbb = 4; if ( r1.aaa > -3.5 ) e(34); if ( fabs ( r1.aaa - r2.aaa ) > epsf ) e(35); +#endif r1.c1 = '\03'; +#ifndef NOFLOAT if ( fabs ( r2.aaa * r1.aaa - r1.c1 * 5 - 1.0 ) > epsf ) e(36); +#else + if ( 5*r1.c1 != 15 ) e(36) ; +#endif } -test8() /* local records */ +test7() /* local records */ { +#ifndef NOFLOAT double epsd; float epsf; double fabs(); +#endif struct tp2 s1, s2; - t = 8; + t = 7; tct++; +#ifndef NOFLOAT epsd = EPSD; epsf = EPSF; +#endif s1.c1 = 'x'; s1.i = 40; s1.j = 50; +#ifndef NOFLOAT s1.aaa = 3.0; s1.bbb = 4.0; +#endif s2.c1 = s1.c1; s2.i = 50; s2.j = 40; +#ifndef NOFLOAT s2.aaa = 4.0; s2.bbb = 5.0; - if ( s1.c1 != 'x' || s1.i != 40 || s1.aaa != 3.0 ) e(1); +#endif + if ( s1.c1 != 'x' || s1.i != 40 ) e(1); +#ifndef NOFLOAT + if ( s1.aaa != 3.0 ) e(1); +#endif if ( s1.i != 40 || s2.i != 50 ) e(2); if ( s2.j != 40 || s1.j != 50 ) e(3); if ( (s1.c1 + s2.c1)/2 != 'x' ) e(4); +#ifndef NOFLOAT if ( s1.aaa * s1.aaa + s2.aaa * s2.aaa != s2.bbb * s2.bbb ) e(5); s1.i = s1.j = s2.i = s2.j = 3.0; +#else + s1.i = s1.j = s2.i = s2.j = 3; +#endif if ( s1.i != 3 ) e(6); if ( s1.i * s2.j - 9 ) e(7); s1.i++; @@ -859,11 +833,13 @@ test8() /* local records */ if ( (s1.i | s1.i | s1.i | s1.i | s1.i) != s1.i ) e(21); if ( (s2.j & s1.j & s2.j & s2.i) != (s1.i<<3>>3) ) e(22); s1.j = 1; +#ifndef NOFLOAT s1.aaa = 2.0; if ( fabs ( s1.j * s1.aaa - 2.0 ) > epsd ) e(23); if ( (s1.j << 4) * s1.aaa != (s1.j << 4) * s1.aaa ) e(24); if ( ((s1.j<<6)&s1.j) * s1.aaa ) e(25); if ((s1.j | (s1.j << 1)) * s1.aaa != ((s1.j << 1) ^ s1.j) * s1.aaa) e(26); +#endif s1.i = s1.j = s2.i = s2.j = -2; if ( s1.i > 0 || s1.j >= 0 ) e(27); if ( s1.i != s2.j ) e(28); @@ -873,33 +849,44 @@ test8() /* local records */ if ( (s1.i % s1.j) % s1.i ) e(31); if ( 0 % s2.j ) e(32); if ( 03 * s1.i != -6 ) e(33); +#ifndef NOFLOAT s1.aaa = s2.aaa = -4; s1.bbb = s2.bbb = 4; if ( s1.aaa > -3.5 ) e(34); if ( fabs ( s1.aaa - s2.aaa ) > epsf ) e(35); +#endif s1.c1 = '\03'; +#ifndef NOFLOAT if ( fabs ( s2.aaa * s1.aaa - s1.c1 * 5 - 1.0 ) > epsf ) e(36); +#else + if ( 5*r1.c1 != 15 ) e(36) ; +#endif } -test9() /* global arrays */ +test8() /* global arrays */ { +#ifndef NOFLOAT float epsf; double epsd; double fabs(); +#endif - t = 9; + t = 8; tct++; +#ifndef NOFLOAT epsf = EPSF; epsd = EPSD; +#endif for ( i=0; i<20 ; i++ ) a1[i] = i*i; if ( a1[9] != 81 || a1[17] != 289 || a1[0] != 0 ) e(1); if ( a1[1] + a1[2] + a1[3] != 14 ) e(2); if ( ! a1[15] ) e(3); if ( a1[8] / a1[4] != 4 ) e(4); +#ifndef NOFLOAT for ( i=0; i<20; i++ ) a2[i] = 10.0e-1 + i/54.324e-1; if ( fabs(a2[4]*a2[4]-a2[4]*(10.0e-1 + 4/54.324e-1 ) ) > epsf ) e(5); @@ -910,6 +897,7 @@ test9() /* global arrays */ if ( fabs(a3[4]*a3[4]-a3[4]*(1.0e0+4/54.324e-1 )) > epsd ) e(8); if ( fabs( a3[8]*a3[9]/a3[8]/a3[9]-a3[10]+a3[10]-1000e-3) > epsd ) e(9); if ( fabs(a3[8]+a3[6]-2*a3[7]) > epsd ) e(10); +#endif for ( i=0; i<20; i++ ) a1[i] = i+1; if ( a1[a1[a1[a1[a1[a1[0]]]]]] != 6 ) e(11); @@ -970,39 +958,50 @@ test9() /* global arrays */ if ( a1[a1[1]^a1[2]^a1[4]^a1[8]] != a1[a1[1]|a1[2]|a1[4]|a1[8]] ) e(50); for ( i = 0; i<20; i++ ) a1[i] = i+1; +#ifndef NOFLOAT for ( i = 0; i<20; i++ ) a2[i] = a3[i] = a1[i]; if ( a2[5] != 6.0 ) e(51); if ( a2[13] != 14.0 ) e(52); if ( a2[a1[a1[a1[a1[a1[0]]]]]] != 6.0 ) e(53); +#endif if ( a1[12] != 13 ) e(54); +#ifndef NOFLOAT if ( a1[ a1[12] = a2[a1[11]] ] != 14 ) e(55); if ( fabs( a2[13] - a2[a1[12]] ) > epsf ) e(56); if ( a2[8] != a1[8] ) e(57); +#endif } -test10() /* local arrays */ +test9() /* local arrays */ { +#ifndef NOFLOAT float epsf; double epsd; double fabs(); +#endif int b1[20]; +#ifndef NOFLOAT float b2[20]; double b3[20]; +#endif - t = 10; + t = 9; tct++; +#ifndef NOFLOAT epsf = EPSF; epsd = EPSD; +#endif for ( i=0; i<20 ; i++ ) b1[i] = i*i; if ( b1[9] != 81 || b1[17] != 289 || b1[0] != 0 ) e(1); if ( b1[1] + b1[2] + b1[3] != 14 ) e(2); if ( ! b1[15] ) e(3); if ( b1[8] / b1[4] != 4 ) e(4); +#ifndef NOFLOAT for ( i=0; i<20; i++ ) b2[i] = 10.0e-1 + i/54.324e-1; if ( fabs(b2[4]*b2[4]-b2[4]*(10.0e-1 + 4/54.324e-1 ) ) > epsf ) e(5); @@ -1013,6 +1012,7 @@ test10() /* local arrays */ if ( fabs(b3[4]*b3[4]-b3[4]*(1.0e0+4/54.324e-1 )) > epsd ) e(8); if ( fabs( b3[8]*b3[9]/b3[8]/b3[9]-b3[10]+b3[10]-1000e-3) > epsd ) e(9); if ( fabs(b3[8]+b3[6]-2*b3[7]) > epsd ) e(10); +#endif for ( i=0; i<20; i++ ) b1[i] = i+1; if ( b1[b1[b1[b1[b1[b1[0]]]]]] != 6 ) e(11); @@ -1073,29 +1073,37 @@ test10() /* local arrays */ if ( b1[b1[1]^b1[2]^b1[4]^b1[8]] != b1[b1[1]|b1[2]|b1[4]|b1[8]] ) e(50); for ( i = 0; i<20; i++ ) b1[i] = i+1; +#ifndef NOFLOAT for ( i = 0; i<20; i++ ) b2[i] = b3[i] = b1[i]; if ( b2[5] != 6.0 ) e(51); if ( b2[13] != 14.0 ) e(52); if ( b2[b1[b1[b1[b1[b1[0]]]]]] != 6.0 ) e(53); +#endif if ( b1[12] != 13 ) e(54); +#ifndef NOFLOAT if ( b1[ b1[12] = b2[b1[11]] ] != 14 ) e(55); if ( fabs( b2[13] - b2[b1[12]] ) > epsf ) e(56); if ( b2[8] != b1[8] ) e(57); +#endif } -test11() /* global pointers */ +test10() /* global pointers */ { +#ifndef NOFLOAT float epsf; double fabs(); +#endif int li; struct tp2 strp2; +#ifndef NOFLOAT epsf = EPSF; - t = 11; +#endif + t = 10; tct++; p1 = &li; li = 076; @@ -1138,6 +1146,7 @@ test11() /* global pointers */ pp1->i++; if ( ++pp2->i != pp1->i ) e(52); if ( pp2->i != 4 ) e(53); +#ifndef NOFLOAT pp1->aaa = 3.0; pp2->aaa = -3.0; pp3->bbb = 25.0; @@ -1145,16 +1154,103 @@ test11() /* global pointers */ if ( fabs( pp1->aaa + pp2->aaa ) > epsf ) e(55); if ( fabs( pp1->aaa * pp2->aaa + pp3->bbb - 16 ) > epsf ) e(56); if ( fabs( pp1->aaa / pp2->aaa + 1 ) > epsf ) e(57); +#endif pp1->c1 = 'x'; pp1->i = pp1->j = 45; +#ifndef NOFLOAT pp1->aaa = 100.0; pp1->bbb = 1024.0; +#endif strp2.c1 = pp1->c1; /* strp2 is a local struct */ strp2.i = pp1->i = strp2.j = pp1->j; +#ifndef NOFLOAT strp2.aaa = pp1->aaa; strp2.bbb = pp1->bbb; +#endif if ( strp2.c1 != 'x' ) e(58); if ( strp2.i != strp2.j ) e(59); +#ifndef NOFLOAT if ( strp2.aaa != pp1->aaa ) e(60); if ( strp2.bbb != pp1->bbb ) e(61); +#endif } + +#ifndef NOFLOAT + +test11() /* real arithmetic */ +{ + double fabs(); + double epsd; + float epsf; + float locxf; + + t = 11 ; + tct++; + epsf = EPSF; + epsd = EPSD; + xf = 1.50; + yf = 3.00; + zf = 0.10; + xd = 1.50; + yd = 3.00; + zd = 0.10; + if ( fabs(1.0 + 1.0 - 2.0) > epsd ) e(1); + if ( fabs( 1e10-1e10 ) > epsd ) e(2); + if ( fabs( 1.0e+5 * 1.0e+5 - 100e+8 ) > epsd ) e(3); + if ( fabs( 10.0/3.0 * 3.0/10.0 - 100e-2 ) > epsd ) e(4); + if ( 0.0e0 != 0 ) e(5); + if ( fabs( 32767.0 - 32767 ) > epsd ) e(6); + if ( fabs( 1.0+2+5+3.0e0+7.5e+1+140e-1-100.0 ) > epsd ) e(7); + if ( fabs(-1+(-1)+(-1.0)+(-1.0e0)+(-1.0e-0)+(-1e0)+6 ) > epsd ) e(8); + if ( fabs(5.0*yf*zf-xf) > epsf ) e(9); + if ( fabs(5.0*yd*zd-xd) > epsd ) e(10); + if ( fabs(yd*yd - (2.0*xd)*(2.0*xd) ) > epsd ) e(11); + if ( fabs(yf*yf - (2.0*xf)*(2.0*xf) ) > epsf ) e(12); + if ( fabs( yd*yd+zd*zd+2.0*yd*zd-(yd+zd)*(zd+yd) ) > epsf ) e(13); + if ( fabs( yf*yf+zf*zf+2.0*yf*zf-(yf+zf)*(zf+yf) ) > epsf ) e(14); + xf = 1.10; + yf = 1.20; + if ( yd=yd ) e(18); + if ( yd epsd ) e(20); + if ( 1.0 * 3.0 != 3.0 * 1.0 ) e(21); + if ( 1.0 != 1e+0 ) e(22); + if ( 4.5 < 4.4 ) e(23); + if ( -3.4 != -3.4 ) e(24); + if ( 10/3.0 - 10/3.0 != 0.0 ) e(25); + if ( fabs( (1<<0) * (-5.3) + 5.3 ) > epsd ) e(26); + if ( fabs( (1<<3) * 5.0 - 4e+1 ) > epsd ) e(27); + if ( fabs( ((1<<5)>>5) - 1e-0 ) > epsd ) e(28); + if ( fabs ( 00000 * 3.0 ) > epsd ) e(29); + if ( fabs ( 8 * 5.0 - 02 * 02 + 04 / 1.0 -40.0 ) > epsd ) e(30); + if ( fabs ( 'a' / 1.0 - 'a' ) > epsd ) e(31); + if ( fabs ( (!1) * ( 2.0 / -34e-1 ) ) > epsd ) e(32); + if ( fabs ( (01 | 1 | 2) * 4.0 - 12.0 ) > epsd ) e(33); + if ( fabs ( 1.0 * 2.0 * 3.0 * 4.0 * 5.0 - 120.0 ) > epsd ) e(34); + if ( fabs ( 1.0 * 2.0 * (1 | (4>>1)) - 6 ) > epsd ) e(35); + if ( fabs ( ( 0 ^ 0 ^ 0 ^ 0 ) * 0.0 ) > epsd ) e(36); + if ( fabs ( 1.0 * 2.0 * (1 ^ (4>>1)) - 6 ) > epsd ) e(37); + if ( fabs ( (((((-1.0 * (((((-1.0))))) - 1.0 ))))) ) > epsd) e(38); + if ( fabs ( ( 2==3 ) * 3.0 ) > epsd ) e(39); + if ( ( 4 + 3 > 5 ? 3.4 : -5e+3 ) != 3.4 ) e(40); + if ( ( -4 -'a' > 0 ? 3.4 : -5e+3 ) != -5e+3 ) e(41); + locxf = 3.0; + xf = 3.0; + if ( locxf != locxf ) e(42); + if ( locxf != xf ) e(43); + if ( locxf * xf != xf * locxf ) e(44); + if ( fabs ( ((2*3)>>1) / 3.0 - 1.0 ) > epsd ) e(45); + if ( fabs ( 'a' / locxf - 'a' / xf ) > epsd ) e(46); + if ( fabs( xf * locxf - 9.0 ) > epsd ) e(47); + yd = 3.0; + if ( fabs( xf*yd - 9.0) > epsd ) e(48); + if ( yd >= 4 ) e(49); + if ( locxf == 2 ) e(50); +} + +#endif + + diff --git a/lang/cem/ctest/ctest2/t7.c b/lang/cem/ctest/ctest2/t7.c index f1a9dd13e..3eaa5bf28 100644 --- a/lang/cem/ctest/ctest2/t7.c +++ b/lang/cem/ctest/ctest2/t7.c @@ -16,6 +16,8 @@ * */ +char rcs_id[] = "$Header$" ; + /* #define TEST1 1 diff --git a/lang/cem/ctest/ctest3/test2.c b/lang/cem/ctest/ctest3/test2.c index 0ffb9a5ba..1a302d047 100644 --- a/lang/cem/ctest/ctest3/test2.c +++ b/lang/cem/ctest/ctest3/test2.c @@ -15,6 +15,8 @@ * */ +char rcs_id[] = "$Header$" ; + /* This program can be used to test C-compilers */ diff --git a/lang/cem/ctest/ctest5/test1.c b/lang/cem/ctest/ctest5/test1.c index 913f0f5ac..5add9a594 100644 --- a/lang/cem/ctest/ctest5/test1.c +++ b/lang/cem/ctest/ctest5/test1.c @@ -15,12 +15,16 @@ * */ +char rcs_id[] = "$Header$" ; + /* This program can be used to test C-compilers */ int i,j,k,l,m,ect,pct,t,*p1; int a1[20]; +#ifndef NOFLOAT float a2[20],xf,yf,zf; double a3[20],xd,yd,zd; +#endif char alstr[3000] ; char *alptr = alstr ; @@ -28,8 +32,10 @@ char *alptr = alstr ; struct tp2 { char c1; int i,j; +#ifndef NOFLOAT float aaa; double bbb; +#endif } r1,r2,*p3; struct node @@ -40,9 +46,12 @@ struct node main() { ect = 0; pct = 0; test1();test2();test3(); - test4();test5();test6(); - test7();test8();test9(); - test10();test11(); + test4();test5(); + test6();test7();test8(); + test9();test10(); +#ifndef NOFLOAT + test11(); +#endif printf("program test1\n"); printf("%d tests completed. Number of errors = %d\n",pct,ect); return 0 ; @@ -61,7 +70,9 @@ char *alloc(size) { } int abs(a) int a ; { return ( a<0 ? -a : a) ; } +#ifndef NOFLOAT double fabs(a) double a ; { return( a<0 ? -a : a) ; } +#endif e(n) { ect++; printf("error %d in test %d \n",n,t); @@ -98,7 +109,7 @@ test1() if ( -'z' / 01 != -'z' ) e(21); if ( 077777 >> 3 != 07777 ) e(22); if ( 077777 >> 15 ) e(23); - if ( 234 << 6 != 234 >> -6 ) e(24); + if ( 234 << 6 != 234 << 6 ) e(24); if ( 0124 & 07765 != 0124 ) e(25); if ( 34 & 31 != 2 ) e(26); if ( ( -4 | 3 ) != -1 ) e(27); @@ -168,8 +179,6 @@ test2() if ( (i > j ? k : k*j ) != 6 ) e(20); if ( (i < j ? k : k*j ) != 3 ) e(21); if ( j<> -i != l ) e(23); - if ( j<< -i != i ) e(24); if ( j>> i != i ) e(25); if ( i++ != 1 ) e(26); if ( --i != 1 ) e(27); @@ -207,8 +216,6 @@ test3() if ( (a > b ? c : c*b ) != 6 ) e(20); if ( (a < b ? c : c*b ) != 3 ) e(21); if ( b<> -a != d ) e(23); - if ( b<< -a != a ) e(24); if ( b>> a != a ) e(25); if ( a++ != 1 ) e(26); if ( --a != 1 ) e(27); @@ -221,14 +228,21 @@ test3() test4() /* global arrays */ -{ float epsf; +{ +#ifndef NOFLOAT + float epsf; double epsd; - t=4; pct++; epsf = 1e-7; epsd = 1e-17; +#endif + t=4; pct++; +#ifndef NOFLOAT + epsf = 1e-7; epsd = 1e-17; +#endif for ( i=0; i<20 ; i++ ) a1[i] = i*i; if ( a1[9] != 81 || a1[17] != 289 || a1[0] != 0 ) e(1); if ( a1[1] + a1[2] + a1[3] != 14 ) e(2); if ( ! a1[15] ) e(3); if ( a1[8] / a1[4] != 4 ) e(4); +#ifndef NOFLOAT for ( i=0; i<20; i++ ) a2[i] = 10.0e-1 + i/54.324e-1; if ( fabs(a2[4]*a2[4]-a2[4]*(10.0e-1 + 4/54.324e-1 ) ) > epsf ) e(5); if ( fabs(a2[8]/a2[8]*a2[9]/a2[9]-a2[10]+a2[10]-1.0 ) > epsf ) e(6); @@ -237,53 +251,25 @@ test4() if ( fabs(a3[4]*a3[4]-a3[4]*(1.0e0+4/54.324e-1 )) > epsd ) e(8); if ( fabs( a3[8]*a3[9]/a3[8]/a3[9]-a3[10]+a3[10]-1000e-3) > epsd ) e(9); if ( fabs(a3[8]+a3[6]-2*a3[7]) > epsd ) e(10); +#endif } -/***************************************************************/ - -test5() -/* real arithmetic */ -{ - double epsd; float epsf; - t = 5; pct++; epsf = 1e-7; epsd = 1e-17; - xf = 1.50 ; yf = 3.00 ; zf = 0.10; - xd = 1.50 ; yd = 3.00 ; zd = 0.10; - if ( fabs(1.0 + 1.0 - 2.0 ) > epsd ) e(1); - if ( fabs( 1e10-1e10 ) > epsd ) e(2); - if ( abs( 1.0e+5*1.0e+5-100e+8 ) > epsd ) e(3); - if ( fabs( 10.0/3.0*3.0/10.0-100e-2 ) > epsd ) e(4); - if ( 0.0e0 != 0 ) e(5); - if ( fabs( 32767.0 - 32767 ) > epsd ) e(6); - if ( fabs( 1.0+2+5+3.0e0+7.5e+1+140e-1-100.0 ) > epsd ) e(7); - if ( fabs(-1+(-1)+(-1.0)+(-1.0e0)+(-1.0e-0)+(-1e0)+6 ) > epsd ) e(8); - if ( fabs(5.0*yf*zf-xf) > epsf ) e(9); - if ( fabs(5.0*yd*zd-xd) > epsd ) e(10); - if ( fabs(yd*yd - (2.0*xd)*(2.0*xd) ) > epsd ) e(11); - if ( fabs(yf*yf - (2.0*xf)*(2.0*xf) ) > epsf ) e(12); - if ( fabs( yd*yd+zd*zd+2.0*yd*zd-(yd+zd)*(zd+yd) ) > epsd ) e(13); - if ( fabs( yf*yf+zf*zf+2.0*yf*zf-(yf+zf)*(zf+yf) ) > epsf ) e(14); - xf=1.10;yf=1.20; - if ( yd=yd ) e(18); - if ( yd epsd ) e(20); -} - - /****************************************************************/ -test6() +test5() /* local arrays */ -{ int b1[20]; float epsf, b2[20]; double b3[20],epsd; +{ int b1[20]; +#ifndef NOFLOAT + float epsf, b2[20]; double b3[20],epsd; epsf = 1e-7; epsd = 1e-17; - t = 6; pct++; +#endif + t = 5; pct++; for ( i=0; i<20 ; i++ ) b1[i] = i*i; if ( b1[9]-b1[8] != 17 ) e(1); if ( b1[3] + b1[4] != b1[5] ) e(2); if ( b1[1] != 1||b1[3] != 9 || b1[5] != 25 || b1[7] != 49 ) e(3); if ( b1[12] / b1[6] != 4 ) e(4); +#ifndef NOFLOAT for ( i=0; i<20; i += 1) b2[i] = 10.0e-1+i/54.324e-1; if (fabs(b2[4]*b2[4]-b2[4]*(10.0e-1+4/54.324e-1)) > epsf ) e(5); if (fabs(b2[8]/b2[8]*b2[9]/b2[9]-b2[10]+b2[10]-1.0) > epsf ) e(6); @@ -292,6 +278,7 @@ test6() if (fabs(b3[4]*b3[4]-b3[4]*(10.0e-1+4/54.324e-1)) > epsd ) e(8); if (fabs(b3[8]*b3[9]/b3[8]/b3[9]+b3[10]-b3[10]-1.0) > epsd ) e(9); if (fabs(b3[10]+b3[18]-2*b3[14]) > epsd ) e(10); +#endif } @@ -299,11 +286,16 @@ test6() -test7() +test6() /* mixed local and global */ { int li,b1[20]; +#ifndef NOFLOAT double b3[10],xxd,epsd; - t = 7; pct++;epsd = 1e-17; +#endif + t = 6; pct++; +#ifndef NOFLOAT + epsd = 1e-17; +#endif li = 6; i = li ; if ( i != 6 ) e(1); i = 6; li = i; @@ -316,27 +308,40 @@ test7() if ( b1[7]/a1[4] != a1[2] ) e(6); li = i = 121; if ( b1[10] != i && a1[11]!= li ) e(7); +#ifndef NOFLOAT for ( li=0 ; li<10; li++ ) b3[li]= 1.0e0 + li/54.324e-1; if ( fabs(b3[9]-a3[9]) > epsd ) e(8); if ( fabs(8/54.324e-1 - b3[9]+a3[1] ) > epsd ) e(9); +#endif } /***************************************************************/ -test8() +test7() /*global records */ -{ t=8; pct++; - r1.c1= 'x';r1.i=40;r1.j=50;r1.aaa=3.0;r1.bbb=4.0; +{ t=7; pct++; + r1.c1= 'x';r1.i=40;r1.j=50; +#ifndef NOFLOAT + r1.aaa=3.0;r1.bbb=4.0; +#endif r2.c1=r1.c1; r2.i= 50; - r2.j=40;r2.aaa=4.0;r2.bbb=5.0; - if (r1.c1 != 'x' || r1.i != 40 || r1.aaa != 3.0 ) e(1); + r2.j=40; +#ifndef NOFLOAT + r2.aaa=4.0;r2.bbb=5.0; +#endif + if (r1.c1 != 'x' || r1.i != 40 ) e(1); +#ifndef NOFLOAT + if ( r1.aaa != 3.0 ) e(1); +#endif i = 25;j=75; if (r1.i != 40 || r2.i != 50 ) e(2); if ( r2.j != 40 || r1.j != 50 ) e(3); if ( (r1.c1 + r2.c1)/2 != 'x' ) e(4); +#ifndef NOFLOAT if ( r1.aaa*r1.aaa+r2.aaa*r2.aaa != r2.bbb*r2.bbb) e(5); +#endif r1.i = 34; if ( i!=25 ) e(6); } @@ -344,29 +349,40 @@ test8() /****************************************************************/ -test9() +test8() /*local records */ { struct tp2 s1,s2; - t=9; pct++; - s1.c1= 'x';s1.i=40;s1.j=50;s1.aaa=3.0;s1.bbb=4.0; + t=8; pct++; + s1.c1= 'x';s1.i=40;s1.j=50; +#ifndef NOFLOAT + s1.aaa=3.0;s1.bbb=4.0; +#endif s2.c1=s1.c1; s2.i= 50; - s2.j=40;s2.aaa=4.0;s2.bbb=5.0; - if (s1.c1 != 'x' || s1.i != 40 || s1.aaa != 3.0 ) e(1); + s2.j=40; +#ifndef NOFLOAT + s2.aaa=4.0;s2.bbb=5.0; +#endif + if (s1.c1 != 'x' || s1.i != 40 ) e(1); +#ifndef NOFLOAT + if ( s1.aaa != 3.0 ) e(1); +#endif i = 25;j=75; if (s1.i != 40 || s2.i != 50 ) e(2); if ( s2.j != 40 || s1.j != 50 ) e(3); if ( (s1.c1 + s2.c1)/2 != 'x' ) e(4); +#ifndef NOFLOAT if ( s1.aaa*s1.aaa+s2.aaa*s2.aaa != s2.bbb*s2.bbb) e(5); +#endif s1.i = 34; if ( i!=25 ) e(6); } /***********************************************************************/ -test10() +test9() /*global pointers */ -{ t=10; pct++; +{ t=9; pct++; p1=alloc( sizeof *p1 ); p2=alloc( sizeof *p2); p3=alloc(sizeof *p3); @@ -397,13 +413,13 @@ test10() } /*****************************************************************/ -test11() +test10() /*local pointers */ { struct tp2 *pp3; struct node *pp2,*ingang,*uitgang; int *pp1; int b1[20]; - t=11; pct++; + t=10; pct++; pp1=alloc( sizeof *pp1 ); pp2=alloc( sizeof *p2); pp3=alloc(sizeof *pp3); @@ -428,4 +444,39 @@ test11() if ( uitgang->next->next->next->next->next->val != 1) e(8); } +/***************************************************************/ + +#ifndef NOFLOAT +test11() +/* real arithmetic */ +{ + double epsd; float epsf; + t = 11; pct++; epsf = 1e-7; epsd = 1e-16; + xf = 1.50 ; yf = 3.00 ; zf = 0.10; + xd = 1.50 ; yd = 3.00 ; zd = 0.10; + if ( fabs(1.0 + 1.0 - 2.0 ) > epsd ) e(1); + if ( fabs( 1e10-1e10 ) > epsd ) e(2); + if ( abs( 1.0e+5*1.0e+5-100e+8 ) > epsd ) e(3); + if ( fabs( 10.0/3.0*3.0/10.0-100e-2 ) > epsd ) e(4); + if ( 0.0e0 != 0 ) e(5); + if ( fabs( 32767.0 - 32767 ) > epsd ) e(6); + if ( fabs( 1.0+2+5+3.0e0+7.5e+1+140e-1-100.0 ) > epsd ) e(7); + if ( fabs(-1+(-1)+(-1.0)+(-1.0e0)+(-1.0e-0)+(-1e0)+6 ) > epsd ) e(8); + if ( fabs(5.0*yf*zf-xf) > epsf ) e(9); + if ( fabs(5.0*yd*zd-xd) > epsd ) e(10); + if ( fabs(yd*yd - (2.0*xd)*(2.0*xd) ) > epsd ) e(11); + if ( fabs(yf*yf - (2.0*xf)*(2.0*xf) ) > epsf ) e(12); + if ( fabs( yd*yd+zd*zd+2.0*yd*zd-(yd+zd)*(zd+yd) ) > epsd ) e(13); + if ( fabs( yf*yf+zf*zf+2.0*yf*zf-(yf+zf)*(zf+yf) ) > epsf ) e(14); + xf=1.10;yf=1.20; + if ( yd=yd ) e(18); + if ( yd epsd ) e(20); +} +#endif + + /*****************************************************************/ diff --git a/lang/cem/ctest/ctill/noarg.c b/lang/cem/ctest/ctill/noarg.c index 5beb6b5f9..7536b4fd5 100644 --- a/lang/cem/ctest/ctill/noarg.c +++ b/lang/cem/ctest/ctill/noarg.c @@ -1,3 +1,5 @@ +char rcs_id[] = "$Header$" ; + main() { none() ; printf("Undetected: declaration of argument not present in argument list\n") ; diff --git a/lang/cem/ctest/ctinit/init.c b/lang/cem/ctest/ctinit/init.c index 91cde4072..48b3779f9 100644 --- a/lang/cem/ctest/ctinit/init.c +++ b/lang/cem/ctest/ctinit/init.c @@ -17,6 +17,8 @@ /* Author: E.G. Keizer */ +char rcs_id[] = "$Header$" ; + /* Test initialisation of a V7 C-compiler */ /* 1 sept 1980 */ #include "../local.h" @@ -90,6 +92,7 @@ pch() { printf("mult[0],mult[1],mult[2] %s, %s, %s\n",mult[0],mult[1],mult[2]); } +#ifndef NOFLOAT /* floats */ float fl1 = 0 ; @@ -171,6 +174,7 @@ printf("dbl1\t%.20e\ndbl2\t%.20e\ndbl2\t%.20e\ndbl4\t%.20e\ndbl5\t%.20e\ndbl6\t% printf("\n") ; } +#endif /* long */ long lo1 = 14L ; @@ -193,12 +197,18 @@ struct s1 { int s_i ; char s_ca[3] ; long s_l ; +#ifndef NOFLOAT double s_f ; +#endif struct s1 *s_s1 ; } ; struct s1 st1 ; struct s1 sta[3] = { +#ifndef NOFLOAT 1 , { 'a' , 'b' , 'c' } , 10 , -10 , &sta[0] , +#else + 1 , { 'a' , 'b' , 'c' } , 10 , &sta[0] , +#endif { 2 } , 3 } ; @@ -229,8 +239,10 @@ pstruct() { st1.s_ca[2],sta[0].s_ca[2],sta[1].s_ca[2],sta[2].s_ca[2]) ; printf("s_l\t%15D%15D%15D%15D\n", st1.s_l,sta[0].s_l,sta[1].s_l,sta[2].s_l) ; +#ifndef NOFLOAT printf("s_f\t %13e %13e %13e %13e\n\n", st1.s_f,sta[0].s_f,sta[1].s_f,sta[2].s_f) ; +#endif printf("(sta[0].s_s1)->s_i = %d\n",(sta[0].s_s1)->s_i) ; printf("\nbit fields:\n\n") ; @@ -242,8 +254,10 @@ pstruct() { main() { pint() ; pch() ; +#ifndef NOFLOAT pflt() ; pdbl() ; +#endif plong() ; pstruct() ; return(0) ; diff --git a/lang/cem/ctest/ctmargt/margt.c b/lang/cem/ctest/ctmargt/margt.c index 8d50389e1..2c26296bc 100644 --- a/lang/cem/ctest/ctmargt/margt.c +++ b/lang/cem/ctest/ctmargt/margt.c @@ -1,3 +1,5 @@ +char rcs_id[] = "$Header$" ; + main(argc,argv,envp) char **argv,**envp ; { register int rargc ; diff --git a/lang/cem/ctest/ctprof/procentry.c b/lang/cem/ctest/ctprof/procentry.c index 2b59f1d4f..01e856638 100644 --- a/lang/cem/ctest/ctprof/procentry.c +++ b/lang/cem/ctest/ctprof/procentry.c @@ -15,6 +15,8 @@ * */ +char rcs_id[] = "$Header$" ; + static int level = 0 ; int procentry(name) char *name ; { register int count ; diff --git a/lang/cem/ctest/ctprof/tp.c b/lang/cem/ctest/ctprof/tp.c index 8b66dd6b3..01b54358f 100644 --- a/lang/cem/ctest/ctprof/tp.c +++ b/lang/cem/ctest/ctprof/tp.c @@ -15,6 +15,8 @@ * */ +char rcs_id2[] = "$Header$" ; + /* Author: E.G. Keizer */ int fac(n) { return ( n==0 ? 1 : n*fac(n-1)) ; } diff --git a/lang/cem/ctest/ctstruct/str.c b/lang/cem/ctest/ctstruct/str.c index 584f5ba5b..7ffb01478 100644 --- a/lang/cem/ctest/ctstruct/str.c +++ b/lang/cem/ctest/ctstruct/str.c @@ -21,9 +21,17 @@ static char rcs_id[]= "$Header$" ; /* test for structure parameters, assignment and return */ # define ASIZE 26 -struct w1 { int w1_i ; } ; -struct w2 { int w2_i ; double w2_d ; } ; -struct w3 { char w3_a[ASIZE] ; double w3_x ; } ; +struct w1 { + int w1_i ; +} ; +struct w2 { + int w2_i ; + long w2_l ; +} ; +struct w3 { + char w3_a[ASIZE] ; + unsigned w3_u ; +} ; struct w1 es1 ; struct w1 es2[3] ; @@ -70,24 +78,24 @@ asst() { printf("w2\n") ; s2t1.w2_i = 18000 ; - s2t1.w2_d = 3.1415 ; + s2t1.w2_l = 31415 ; s2t2 = s2t1 ; - printf("\ts2t2: .w2_i %d .w2_d %f\n",s2t2.w2_i,s2t2.w2_d) ; + printf("\ts2t2: .w2_i %d .w2_l %ld\n",s2t2.w2_i,s2t2.w2_l) ; s2t3 = &s2t2 ; - printf("\ts2t3->w2_d %f\n",s2t3->w2_d) ; + printf("\ts2t3->w2_l %ld\n",s2t3->w2_l) ; printf("w3\n") ; for ( i = 0 ; i + +char rcs_id[] = "$Header$" ; + foo() { printf("signal received\n"); diff --git a/lang/cem/ctest/ctsys/tfork.c b/lang/cem/ctest/ctsys/tfork.c index 5aca4fe6f..d635cadce 100644 --- a/lang/cem/ctest/ctsys/tfork.c +++ b/lang/cem/ctest/ctsys/tfork.c @@ -1,3 +1,5 @@ +char rcs_id[] = "$Header$" ; + main(argc,argv) char **argv ; { int child, waitchild ; int status ; -- 2.34.1