2 !!DESCRIPTION!! C-Manual Chapter 9: Statements
3 !!ORIGIN!! LCC 4.1 Testsuite
4 !!LICENCE!! own, freely distributeable for non-profit. read CPYRIGHT.LCC
8 int cbits; /* No. of bits per char */
10 int sbits; /* short */
12 int ubits; /* unsigned */
13 int fbits; /* float */
14 int dbits; /* double */
16 float fprec; /* Smallest number that can be */
17 float dprec; /* significantly added to 1. */
19 int flgs; /* Print return codes, by section */
20 int flgm; /* Announce machine dependencies */
21 int flgd; /* give explicit diagnostics */
22 int flgl; /* Report local return codes. */
23 int rrc; /* recent return code */
24 int crc; /* Cumulative return code */
25 char rfs[8]; /* Return from section */
29 int ubits; /* unsigned */
30 int fbits; /* float */
31 int dbits; /* double */
33 float fprec; /* Smallest number that can be */
34 float dprec; /* significantly added to 1. */
36 int flgs; /* Print return codes, by section */
37 int flgm; /* Announce machine dependencies */
38 int flgd; /* give explicit diagnostics */
39 int flgl; /* Report local return codes. */
40 int rrc; /* recent return code */
41 int crc; /* Cumulative return code */
42 char rfs[8]; /* Return from section */
44 #ifndef NO_OLD_FUNC_DECL
45 s9(pd0) /* 9 Statements */
49 int s9(struct defs *pd0){
51 static char s9er[] = "s9,er%d\n";
52 static char qs9[8] = "s9 ";
60 while (*pt++ = *ps++);
62 /* One would think that the section on statements would
63 provide the most variety in the entire sequence of tests.
64 As it turns out, most of the material in this section has
65 already been checked in the process of checking out
66 everything else, and the section at this point is somewhat
67 anticlimactic. For this reason, we restrict ourselves
68 to testing two features not already covered.
70 Compound statements are delimited by braces. They have the
71 nice property that identifiers of the auto and register
72 variety are pushed and popped. It is currently legal to
73 transfer into a block, but we wont...
85 if((j != 3) || (k != 3)) lrc = 1;
87 if((j != 2) || (k != 2)) lrc = 1;
91 if(pd0->flgd != 0) printf(s9er,1);
95 /* Goto statements go to labeled statements, we hope. */
98 if(pd0->flgd != 0) printf(s9er,2);
105 /*********************************************************************************************
106 the main loop that launches the sections
107 *********************************************************************************************/
109 #ifndef NO_TYPELESS_STRUCT_PTR
110 int section(int j,struct* pd0){
112 int section(int j,void* pd0){
115 case 0: return s9(pd0);
119 #define cq_sections 1
122 C REFERENCE MANUAL (main)
125 #ifndef NO_OLD_FUNC_DECL
131 int main(int n,char **args) {
135 static struct defs d0, *pd0;
137 d0.flgs = 1; /* These flags dictate */
138 d0.flgm = 1; /* the verbosity of */
139 d0.flgd = 1; /* the program. */
144 for (j=0; j<cq_sections; j++) {
145 d0.rrc=section(j,pd0);
146 d0.crc=d0.crc+d0.rrc;
147 if(d0.flgs != 0) printf("Section %s returned %d.\n",d0.rfs,d0.rrc);
150 if(d0.crc == 0) printf("\nNo errors detected.\n");
151 else printf("\nFailed.\n");