2 !!DESCRIPTION!! C-Manual Chapter 9: Statements
3 !!ORIGIN!! LCC 4.1 Testsuite
4 !!LICENCE!! own, freely distributeable for non-profit. read CPYRIGHT.LCC
10 int cbits; /* No. of bits per char */
12 int sbits; /* short */
14 int ubits; /* unsigned */
15 int fbits; /* float */
16 int dbits; /* double */
18 float fprec; /* Smallest number that can be */
19 float dprec; /* significantly added to 1. */
21 int flgs; /* Print return codes, by section */
22 int flgm; /* Announce machine dependencies */
23 int flgd; /* give explicit diagnostics */
24 int flgl; /* Report local return codes. */
25 int rrc; /* recent return code */
26 int crc; /* Cumulative return code */
27 char rfs[8]; /* Return from section */
31 int ubits; /* unsigned */
32 int fbits; /* float */
33 int dbits; /* double */
35 float fprec; /* Smallest number that can be */
36 float dprec; /* significantly added to 1. */
38 int flgs; /* Print return codes, by section */
39 int flgm; /* Announce machine dependencies */
40 int flgd; /* give explicit diagnostics */
41 int flgl; /* Report local return codes. */
42 int rrc; /* recent return code */
43 int crc; /* Cumulative return code */
44 char rfs[8]; /* Return from section */
46 #ifndef NO_OLD_FUNC_DECL
47 s9(pd0) /* 9 Statements */
51 int s9(struct defs *pd0){
53 static char s9er[] = "s9,er%d\n";
54 static char qs9[8] = "s9 ";
62 while (*pt++ = *ps++);
64 /* One would think that the section on statements would
65 provide the most variety in the entire sequence of tests.
66 As it turns out, most of the material in this section has
67 already been checked in the process of checking out
68 everything else, and the section at this point is somewhat
69 anticlimactic. For this reason, we restrict ourselves
70 to testing two features not already covered.
72 Compound statements are delimited by braces. They have the
73 nice property that identifiers of the auto and register
74 variety are pushed and popped. It is currently legal to
75 transfer into a block, but we wont...
87 if((j != 3) || (k != 3)) lrc = 1;
89 if((j != 2) || (k != 2)) lrc = 1;
93 if(pd0->flgd != 0) printf(s9er,1);
97 /* Goto statements go to labeled statements, we hope. */
100 if(pd0->flgd != 0) printf(s9er,2);
107 /*********************************************************************************************
108 the main loop that launches the sections
109 *********************************************************************************************/
111 #ifndef NO_TYPELESS_STRUCT_PTR
112 int section(int j,struct* pd0){
114 int section(int j,void* pd0){
117 case 0: return s9(pd0);
121 #define cq_sections 1
124 C REFERENCE MANUAL (main)
127 #ifndef NO_OLD_FUNC_DECL
133 int main(int n,char **args) {
137 static struct defs d0, *pd0;
139 d0.flgs = 1; /* These flags dictate */
140 d0.flgm = 1; /* the verbosity of */
141 d0.flgd = 1; /* the program. */
146 for (j=0; j<cq_sections; j++) {
147 d0.rrc=section(j,pd0);
148 d0.crc=d0.crc+d0.rrc;
149 if(d0.flgs != 0) printf("Section %s returned %d.\n",d0.rfs,d0.rrc);
152 if(d0.crc == 0) printf("\nNo errors detected.\n");
153 else printf("\nFailed.\n");