OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [lcc/] [tst/] [cq.c] - Blame information for rev 106

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 hellwig
   struct defs {
2
     int cbits;          /* No. of bits per char           */
3
     int ibits;          /*                 int            */
4
     int sbits;          /*                 short          */
5
     int lbits;          /*                 long           */
6
     int ubits;          /*                 unsigned       */
7
     int fbits;          /*                 float          */
8
     int dbits;          /*                 double         */
9
     float fprec;        /* Smallest number that can be    */
10
     float dprec;        /* significantly added to 1.      */
11
     int flgs;           /* Print return codes, by section */
12
     int flgm;           /* Announce machine dependencies  */
13
     int flgd;           /* give explicit diagnostics      */
14
     int flgl;           /* Report local return codes.     */
15
     int rrc;            /* recent return code             */
16
     int crc;            /* Cumulative return code         */
17
     char rfs[8];        /* Return from section            */
18
   };
19
main(n,args)               /* C REFERENCE MANUAL         */
20
int n;
21
char **args;
22
{
23
 
24
/*   This program performs a series of tests on a C compiler,
25
based on information in the
26
 
27
             C REFERENCE MANUAL
28
 
29
which appears as Appendix A to the book "The C Programming
30
Language" by Brian W. Kernighan and Dennis M. Ritchie
31
(Prentice-Hall, 1978, $10.95). This Appendix is hereafter
32
referred to as "the Manual".
33
 
34
     The rules followed in writing this program are:
35
 
36
     1. The entire program is written in legal C, according
37
     to the Manual. It should compile with no error messages,
38
     although some warning messages may be produced by some
39
     compilers. Failure to compile should be interpreted as
40
     a compiler error.
41
 
42
     2. The program is clean, in that it does not make use
43
     of any features of the operating system on which it runs,
44
     with the sole exceptions of the printf() function, and an
45
     internal "options" routine, which is easily excised.
46
 
47
     3. No global variables are used, except for the spec-
48
     ific purpose of testing the global variable facility.
49
 
50
     The program is divided into modules having names of the
51
form snnn... These modules correspond to those sections of the
52
Manual, as identified by boldface type headings, in which
53
there is something to test. For example, s241() corresponds
54
to section 2.4.1 of the Manual (Integer constants) and tests
55
the facilities described therein. The module numbering
56
scheme is ambiguous, especially when it names modules
57
referring to more than one section; module s7813, for ex-
58
ample, deals with sections 7.8 through 7.13. Nonetheless,
59
it is surprisingly easy to find a section in the Manual
60
corresponding to a section of code, and vice versa.
61
 
62
     Note also that there seem to be "holes" in the program,
63
at least from the point of view that there exist sections in the
64
Manual for which there is no corresponding code. Such holes
65
arise from three causes: (a) there is nothing in that partic-
66
ular section to test, (b) everything in that section is tested
67
elsewhere, and (c) it was deemed advisable not to check cer-
68
tain features like preprocessor or listing control features.
69
 
70
     Modules are called by a main program main(). The mod-
71
ules that are called, and the sequence in which they are
72
called, are determined by two lists in main(), in which the
73
module names appear. The first list (an extern statement)
74
declares the module names to be external. The second (a stat-
75
ic int statement) names the modules and defines the sequence
76
in which they are called. There is no need for these lists
77
to be in the same order, but it is probably a good idea to keep
78
them that way in the interest of clarity. Since there are no
79
cross-linkages between modules, new modules may be added,
80
or old ones deleted, simply by editing the lists, with one
81
exception: section s26, which pokes around at the hardware
82
trying to figure out the characteristics of the machine that
83
it is running on, saves information that is subsequently
84
used by sections s626, s72, and s757. If this program is
85
to be broken up into smallish pieces, say for running on
86
a microcomputer, take care to see that s26 is called before
87
calling any of the latter three sections.  The size
88
of the lists, i.e., the number of modules to be called, is
89
not explicitly specified as a program parameter, but is
90
determined dynamically using the sizeof operator.
91
 
92
     Communication between the main program and the modules
93
takes place in two ways. In all cases, a pointer to a structure
94
is passed to the called module. The structure contains flags
95
that will determine the type of information to be published
96
by the module, and fields that may be written in by the
97
module. The former include "flgm" and "flgd", which, if set
98
to a nonzero value, specify that machine dependencies are to
99
be announced or that error messages are to be printed, re-
100
spectively. The called module's name, and the hardware char-
101
acteristics probed in s26() comprise the latter.
102
 
103
 
104
     Also, in all cases, a return code is returned by the called
105
module. A return code of zero indicates that all has gone well;
106
nonzero indicates otherwise. Since more than one type of error
107
may be detected by a module, the return code is a composite
108
of error indicators, which, individually, are given as numbers
109
that are powers of two. Thus, a return code of 10 indicates
110
that two specific errors, 8 and 2, were detected. Whether or
111
not the codes returned by the modules are printed by the main
112
program is determined by setting "flgs" to 1 (resp. 0).
113
 
114
     The entire logic of the main program is contained in the
115
half-dozen or so lines at the end. The somewhat cryptic
116
statement:
117
 
118
           d0.rrc = (*sec[j])(pd0);
119
 
120
in the for loop calls the modules. The rest of the code is
121
reasonably straightforward.
122
 
123
     Finally, in each of the modules, there is the following
124
prologue:
125
 
126
           snnn(pd0)
127
           struct defs *pd0;
128
           {
129
              static char snnner[] = "snnn,er%d\n";
130
              static char qsnnn[8] = "snnn   ";
131
              char *ps, *pt;
132
              int rc;
133
 
134
              rc = 0;
135
              ps = qsnnn;
136
              pt = pd0->rfs;
137
              while(*pt++ = *ps++);
138
 
139
used for housekeeping, handshaking and module initialization.
140
 
141
                                                           */
142
   extern
143
     s22(struct defs *),
144
     s241(struct defs *),
145
     s243(struct defs *),
146
     s244(struct defs *),
147
     s25(struct defs *),
148
     s26(struct defs *),
149
     s4(struct defs *),
150
     s61(struct defs *),
151
     s626(struct defs *),
152
     s71(struct defs *),
153
     s72(struct defs *),
154
     s757(struct defs *),
155
     s7813(struct defs *),
156
     s714(struct defs *),
157
     s715(struct defs *),
158
     s81(struct defs *),
159
     s84(struct defs *),
160
     s85(struct defs *),
161
     s86(struct defs *),
162
     s88(struct defs *),
163
     s9(struct defs *)
164
   ;
165
 
166
   int j;
167
   static int (*sec[])() = {
168
     s22,
169
     s241,
170
     s243,
171
     s244,
172
     s25,
173
     s26,
174
     s4,
175
     s61,
176
     s626,
177
     s71,
178
     s72,
179
     s757,
180
     s7813,
181
     s714,
182
     s715,
183
     s81,
184
     s84,
185
     s85,
186
     s86,
187
     s88,
188
     s9
189
   };
190
 
191
   static struct defs d0, *pd0;
192
 
193
     d0.flgs = 1;          /* These flags dictate            */
194
     d0.flgm = 1;          /*     the verbosity of           */
195
     d0.flgd = 1;          /*         the program.           */
196
     d0.flgl = 1;
197
 
198
   pd0 = &d0;
199
 
200
   for (j=0; j<sizeof(sec) / sizeof(sec[0]); j++) {
201
     d0.rrc = (*sec[j])(pd0);
202
     d0.crc = d0.crc+d0.rrc;
203
     if(d0.flgs != 0) printf("Section %s returned %d.\n",d0.rfs,d0.rrc);
204
   }
205
 
206
   if(d0.crc == 0) printf("\nNo errors detected.\n");
207
   else printf("\nFailed.\n");
208
   return 0;
209
}
210
s22(pd0)                 /* 2.2 Identifiers (Names)      */
211
struct defs *pd0;
212
{
213
   int a234, a;
214
   int _, _234, A, rc;
215
 
216
   static char s22er[] = "s22,er%d\n";
217
   static char qs22[8] = "s22    ";
218
 
219
   char *ps, *pt;
220
                         /* Initialize                      */
221
 
222
   rc = 0;
223
   ps = qs22;
224
   pt = pd0 -> rfs;
225
   while (*pt++ = *ps++);
226
 
227
     /* An identifier is a sequence of letters and digits;
228
        the first character must be a letter. The under-
229
        score _ counts as a letter.                        */
230
 
231
   a=1;
232
   _=2;
233
   _234=3;
234
   a234=4;
235
   if(a+_+_234+a234 != 10) {
236
     rc = rc+1;
237
     if(pd0->flgd != 0) printf(s22er,1);
238
   }
239
 
240
   /* Upper and lower case letters are different.     */
241
 
242
   A = 2;
243
   if (A == a) {
244
     rc = rc+4;
245
     if (pd0->flgd != 0) printf(s22er,4);
246
   }
247
 
248
   return(rc);
249
}
250
s241(pd0)                   /* 2.4.1 Integer constants
251
                               2.4.2 Explicit long constants  */
252
struct defs *pd0;
253
{
254
   long pow2();
255
   static char s241er[] = "s241,er%d\n";
256
   static char qs241[8] = "s241   ";
257
   char *ps, *pt;
258
   int rc, j, lrc;
259
   static long g[39] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
260
                        0,6,0,8,0,12,0,16,0,18,0,20,0,24,
261
                        0,28,0,30,0,32,0,36};
262
   long d[39], o[39], x[39];
263
 
264
   rc = 0;
265
   lrc = 0;
266
   ps = qs241;
267
   pt = pd0 -> rfs;
268
   while (*pt++ = *ps++);
269
 
270
     /* An integer constant consisting of a sequence of digits is
271
        taken to be octal if it begins with 0 (digit zero), decimal
272
        otherwise.                                            */
273
 
274
   if (   8 !=  010
275
     ||  16 !=  020
276
     ||  24 !=  030
277
     ||  32 !=  040
278
     ||  40 !=  050
279
     ||  48 !=  060
280
     ||  56 !=  070
281
     ||  64 != 0100
282
     ||  72 != 0110
283
     ||  80 != 0120
284
     ||   9 != 0011
285
     ||  17 != 0021
286
     ||  25 != 0031
287
     ||  33 != 0041
288
     ||  41 != 0051
289
     ||  49 != 0061
290
     ||  57 != 0071
291
     ||  65 != 0101
292
     ||  73 != 0111
293
     ||  81 != 0121 ){
294
 
295
     rc = rc+1;
296
     if( pd0->flgd != 0 ) printf(s241er,1);
297
   }
298
 
299
     /* A sequence of digits preceded by 0x or 0X (digit zero)
300
        is taken to be a hexadecimal integer. The hexadecimal
301
        digits include a or A through f or F with values 10
302
        through 15.     */
303
 
304
   if ( 0x00abcdef != 0xabcdef
305
     || 0xabcdef != 0Xabcdef || 0Xabcdef != 0XAbcdef
306
     || 0XAbcdef != 0XABcdef || 0XABcdef != 0XABCdef
307
     || 0XABCdef != 0XABCDef || 0XABCDef != 0XABCDEf
308
     || 0XABCDEf != 0XABCDEF || 0xABCDEF != 11259375 ){
309
 
310
     rc = rc+2;
311
     if( pd0->flgd != 0 ) printf(s241er,2);
312
   }
313
 
314
     /* A decimal constant whose value exceeds the largest signed
315
        machine integer is taken to be long; an octal or hex con-
316
        stant which exceeds the largest unsigned machine integer
317
        is likewise taken to be long.     */
318
 
319
   if ( sizeof 010000000000 != sizeof(long)      /* 2**30 */
320
     || sizeof 1073741824   != sizeof(long)      /* ditto */
321
     || sizeof 0x40000000   != sizeof(long) ){   /*   "   */
322
 
323
     rc = rc+4;
324
     if( pd0->flgd != 0 ) printf(s241er,4);
325
   }
326
 
327
     /* A decimal, octal, or hexadecimal constant immediately followed
328
        by l (letter ell) or L is a long constant.    */
329
 
330
   if ( sizeof   67l != sizeof(long)
331
     || sizeof   67L != sizeof(long)
332
     || sizeof  067l != sizeof(long)
333
     || sizeof  067L != sizeof(long)
334
     || sizeof 0X67l != sizeof(long)
335
     || sizeof 0x67L != sizeof(long) ){
336
 
337
     rc = rc+8;
338
     if( pd0 -> flgd != 0 ) printf(s241er,8);
339
   }
340
 
341
     /* Finally, we test to see that decimal (d), octal (o),
342
        and hexadecimal (x) constants representing the same values
343
        agree among themselves, and with computed values, at spec-
344
        ified points over an appropriate range. The points select-
345
        ed here are those with the greatest potential for caus-
346
        ing trouble, i.e., zero, 1-16, and values of 2**n and
347
        2**n - 1 where n is some multiple of 4 or 6. Unfortunately,
348
        just what happens when a value is too big to fit in a
349
        long is undefined; however, it would be nice if what
350
        happened were at least consistent...      */
351
 
352
   for ( j=0; j<17; j++ ) g[j] = j;
353
   for ( j=18; j<39; ) {
354
     g[j] = pow2(g[j]);
355
     g[j-1] = g[j] - 1;
356
     j = j+2;
357
   }
358
 
359
   d[0] = 0;                o[0] = 00;               x[0] = 0x0;
360
   d[1] = 1;                o[1] = 01;               x[1] = 0x1;
361
   d[2] = 2;                o[2] = 02;               x[2] = 0x2;
362
   d[3] = 3;                o[3] = 03;               x[3] = 0x3;
363
   d[4] = 4;                o[4] = 04;               x[4] = 0x4;
364
   d[5] = 5;                o[5] = 05;               x[5] = 0x5;
365
   d[6] = 6;                o[6] = 06;               x[6] = 0x6;
366
   d[7] = 7;                o[7] = 07;               x[7] = 0x7;
367
   d[8] = 8;                o[8] = 010;              x[8] = 0x8;
368
   d[9] = 9;                o[9] = 011;              x[9] = 0x9;
369
   d[10] = 10;              o[10] = 012;             x[10] = 0xa;
370
   d[11] = 11;              o[11] = 013;             x[11] = 0xb;
371
   d[12] = 12;              o[12] = 014;             x[12] = 0xc;
372
   d[13] = 13;              o[13] = 015;             x[13] = 0xd;
373
   d[14] = 14;              o[14] = 016;             x[14] = 0xe;
374
   d[15] = 15;              o[15] = 017;             x[15] = 0xf;
375
   d[16] = 16;              o[16] = 020;             x[16] = 0x10;
376
   d[17] = 63;              o[17] = 077;             x[17] = 0x3f;
377
   d[18] = 64;              o[18] = 0100;            x[18] = 0x40;
378
   d[19] = 255;             o[19] = 0377;            x[19] = 0xff;
379
   d[20] = 256;             o[20] = 0400;            x[20] = 0x100;
380
   d[21] = 4095;            o[21] = 07777;           x[21] = 0xfff;
381
   d[22] = 4096;            o[22] = 010000;          x[22] = 0x1000;
382
   d[23] = 65535;           o[23] = 0177777;         x[23] = 0xffff;
383
   d[24] = 65536;           o[24] = 0200000;         x[24] = 0x10000;
384
   d[25] = 262143;          o[25] = 0777777;         x[25] = 0x3ffff;
385
   d[26] = 262144;          o[26] = 01000000;        x[26] = 0x40000;
386
   d[27] = 1048575;         o[27] = 03777777;        x[27] = 0xfffff;
387
   d[28] = 1048576;         o[28] = 04000000;        x[28] = 0x100000;
388
   d[29] = 16777215;        o[29] = 077777777;       x[29] = 0xffffff;
389
   d[30] = 16777216;        o[30] = 0100000000;      x[30] = 0x1000000;
390
   d[31] = 268435455;       o[31] = 01777777777;     x[31] = 0xfffffff;
391
   d[32] = 268435456;       o[32] = 02000000000;     x[32] = 0x10000000;
392
   d[33] = 1073741823;      o[33] = 07777777777;     x[33] = 0x3fffffff;
393
   d[34] = 1073741824;      o[34] = 010000000000;    x[34] = 0x40000000;
394
   d[35] = 4294967295;      o[35] = 037777777777;    x[35] = 0xffffffff;
395
   d[36] = 4294967296;      o[36] = 040000000000;    x[36] = 0x100000000;
396
   d[37] = 68719476735;     o[37] = 0777777777777;   x[37] = 0xfffffffff;
397
   d[38] = 68719476736;     o[38] = 01000000000000;  x[38] = 0x1000000000;
398
 
399
   /* WHEW! */
400
 
401
   for (j=0; j<39; j++){
402
     if ( g[j] != d[j]
403
       || d[j] != o[j]
404
       || o[j] != x[j]) {
405
 
406
       if( pd0 -> flgm != 0 ) {
407
/*       printf(s241er,16);          save in case opinions change...     */
408
         printf("Decimal and octal/hex constants sometimes give\n");
409
         printf("   different results when assigned to longs.\n");
410
       }
411
/*     lrc = 1;   save...   */
412
     }
413
   }
414
 
415
   if (lrc != 0) rc =16;
416
 
417
   return rc;
418
}
419
 
420
long pow2(n)        /* Calculate 2**n by multiplying, not shifting  */
421
long n;
422
{
423
   long s;
424
   s = 1;
425
   while(n--) s = s*2;
426
   return s;
427
}
428
s243(pd0)                   /*  2.4.3 Character constants  */
429
struct defs *pd0;
430
{
431
   static char s243er[] = "s243,er%d\n";
432
   static char qs243[8] = "s243   ";
433
   char *ps, *pt;
434
   int rc;
435
   char chars[256];
436
 
437
   rc = 0;
438
   ps = qs243;
439
   pt = pd0->rfs;
440
   while(*pt++ = *ps++);
441
 
442
     /* One of the problems that arises when testing character constants
443
        is that of definition: What, exactly, is the character set?
444
        In order to guarantee a certain amount of machine independence,
445
        the character set we will use here is the set of characters writ-
446
        able as escape sequences in C, plus those characters used in writ-
447
        ing C programs, i.e.,
448
 
449
        letters:
450
                   ABCDEFGHIJKLMNOPQRSTUVWXYZ      26
451
                   abcdefghijklmnopqrstuvwxyz      26
452
        numbers:
453
                   0123456789                      10
454
        special characters:
455
                   ~!"#%&()_=-^|{}[]+;*:<>,.?/     27
456
        extra special characters:
457
                   newline           \n
458
                   horizontal tab    \t
459
                   backspace         \b
460
                   carriage return   \r
461
                   form feed         \f
462
                   backslash         \\
463
                   single quote      \'             7
464
        blank & NUL                                 2
465
                                                  ---
466
                                                   98
467
 
468
        Any specific implementation of C may of course support additional
469
        characters.                                       */
470
 
471
        /* Since the value of a character constant is the numerical value
472
           of the character in the machine's character set, there should
473
           be a one-to-one correspondence between characters and values. */
474
 
475
   zerofill(chars);
476
 
477
   chars['a'] = 1;   chars['A'] = 1;   chars['~'] = 1;   chars['0'] = 1;
478
   chars['b'] = 1;   chars['B'] = 1;   chars['!'] = 1;   chars['1'] = 1;
479
   chars['c'] = 1;   chars['C'] = 1;   chars['"'] = 1;   chars['2'] = 1;
480
   chars['d'] = 1;   chars['D'] = 1;   chars['#'] = 1;   chars['3'] = 1;
481
   chars['e'] = 1;   chars['E'] = 1;   chars['%'] = 1;   chars['4'] = 1;
482
   chars['f'] = 1;   chars['F'] = 1;   chars['&'] = 1;   chars['5'] = 1;
483
   chars['g'] = 1;   chars['G'] = 1;   chars['('] = 1;   chars['6'] = 1;
484
   chars['h'] = 1;   chars['H'] = 1;   chars[')'] = 1;   chars['7'] = 1;
485
   chars['i'] = 1;   chars['I'] = 1;   chars['_'] = 1;   chars['8'] = 1;
486
   chars['j'] = 1;   chars['J'] = 1;   chars['='] = 1;   chars['9'] = 1;
487
   chars['k'] = 1;   chars['K'] = 1;   chars['-'] = 1;
488
   chars['l'] = 1;   chars['L'] = 1;   chars['^'] = 1;
489
   chars['m'] = 1;   chars['M'] = 1;   chars['|'] = 1;   chars['\n'] = 1;
490
   chars['n'] = 1;   chars['N'] = 1;                     chars['\t'] = 1;
491
   chars['o'] = 1;   chars['O'] = 1;   chars['{'] = 1;   chars['\b'] = 1;
492
   chars['p'] = 1;   chars['P'] = 1;   chars['}'] = 1;   chars['\r'] = 1;
493
   chars['q'] = 1;   chars['Q'] = 1;   chars['['] = 1;   chars['\f'] = 1;
494
   chars['r'] = 1;   chars['R'] = 1;   chars[']'] = 1;
495
   chars['s'] = 1;   chars['S'] = 1;   chars['+'] = 1;   chars['\\'] = 1;
496
   chars['t'] = 1;   chars['T'] = 1;   chars[';'] = 1;   chars['\''] = 1;
497
   chars['u'] = 1;   chars['U'] = 1;   chars['*'] = 1;
498
   chars['v'] = 1;   chars['V'] = 1;   chars[':'] = 1;   chars['\0'] = 1;
499
   chars['w'] = 1;   chars['W'] = 1;   chars['<'] = 1;   chars[' '] = 1;
500
   chars['x'] = 1;   chars['X'] = 1;   chars['>'] = 1;
501
   chars['y'] = 1;   chars['Y'] = 1;   chars[','] = 1;
502
   chars['z'] = 1;   chars['Z'] = 1;   chars['.'] = 1;
503
                                       chars['?'] = 1;
504
                                       chars['/'] = 1;
505
 
506
   if(sumof(chars) != 98){
507
     rc = rc+1;
508
     if(pd0->flgd != 0) printf(s243er,1);
509
   }
510
 
511
   /* Finally, the escape \ddd consists of the backslash followed
512
      by 1, 2, or 3 octal digits which are taken to specify  the
513
      desired character.                           */
514
 
515
   if( '\0'    !=   0 || '\01'   !=   1 || '\02'   !=   2
516
    || '\03'   !=   3 || '\04'   !=   4 || '\05'   !=   5
517
    || '\06'   !=   6 || '\07'   !=   7 || '\10'   !=   8
518
    || '\17'   !=  15 || '\20'   !=  16 || '\77'   !=  63
519
    || '\100'  !=  64 || '\177'  != 127                 ){
520
 
521
     rc = rc+8;
522
     if(pd0->flgd != 0) printf(s243er,8);
523
   }
524
 
525
   return rc;
526
}
527
zerofill(x)
528
char *x;
529
{
530
   int j;
531
 
532
   for (j=0; j<256; j++) *x++ = 0;
533
}
534
sumof(x)
535
char *x;
536
{
537
   char *p;
538
   int total, j;
539
 
540
   p = x;
541
   total = 0;
542
 
543
   for(j=0; j<256; j++) total = total+ *p++;
544
   return total;
545
}
546
s244(pd0)
547
struct defs *pd0;
548
{
549
   double a[8];
550
   int rc, lrc, j;
551
   static char s244er[] = "s244,er%d\n";
552
   static char qs244[8] = "s244   ";
553
   char *ps, *pt;
554
 
555
   ps = qs244;
556
   pt = pd0->rfs;
557
   while(*pt++ = *ps++);
558
   rc = 0;
559
   lrc = 0;
560
 
561
   /* Unfortunately, there's not a lot we can do with floating constants.
562
      We can check to see that the various representations can be com-
563
      piled, that the conversion is such that they yield the same hard-
564
      ware representations in all cases, and that all representations
565
      thus checked are double precision.              */
566
 
567
   a[0] = .1250E+04;
568
   a[1] = 1.250E3;
569
   a[2] = 12.50E02;
570
   a[3] = 125.0e+1;
571
   a[4] = 1250e00;
572
   a[5] = 12500.e-01;
573
   a[6] = 125000e-2;
574
   a[7] = 1250.;
575
 
576
   lrc = 0;
577
   for (j=0; j<7; j++) if(a[j] != a[j+1]) lrc = 1;
578
 
579
   if(lrc != 0) {
580
     if(pd0->flgd != 0) printf(s244er,1);
581
     rc = rc+1;
582
   }
583
 
584
   if ( (sizeof .1250E+04 ) != sizeof(double)
585
     || (sizeof 1.250E3   ) != sizeof(double)
586
     || (sizeof 12.50E02  ) != sizeof(double)
587
     || (sizeof 1.250e+1  ) != sizeof(double)
588
     || (sizeof 1250e00   ) != sizeof(double)
589
     || (sizeof 12500.e-01) != sizeof(double)
590
     || (sizeof 125000e-2 ) != sizeof(double)
591
     || (sizeof 1250.     ) != sizeof(double)){
592
 
593
     if(pd0->flgd != 0) printf(s244er,2);
594
     rc = rc+2;
595
   }
596
 
597
   return rc;
598
}
599
s25(pd0)
600
struct defs *pd0;
601
{
602
   char *s, *s2;
603
   int rc, lrc, j;
604
   static char s25er[] = "s25,er%d\n";
605
   static char qs25[8] = "s25    ";
606
   char *ps, *pt;
607
 
608
   ps = qs25;
609
   pt = pd0->rfs;
610
   while(*pt++ = *ps++);
611
   rc = 0;
612
 
613
   /* A string is a sequence of characters surrounded by double
614
      quotes, as in "...".                         */
615
 
616
   s = "...";
617
 
618
   /* A string has type "array of characters" and storage class
619
      static and is initialized with the given characters.  */
620
 
621
   if ( s[0] != s[1] || s[1] != s[2]
622
     || s[2] != '.' ) {
623
 
624
    rc = rc+1;
625
     if(pd0->flgd != 0) printf(s25er,1);
626
   }
627
 
628
   /* The compiler places a null byte \0 at the end of each string
629
      so the program which scans the string can find its end.   */
630
 
631
   if( s[3] != '\0' ){
632
     rc = rc+4;
633
     if(pd0->flgd != 0) printf(s25er,4);
634
   }
635
 
636
   /* In a string, the double quote character " must be preceded
637
      by a \.                                               */
638
 
639
    if( ".\"."[1] != '"' ){
640
    rc = rc+8;
641
     if(pd0->flgd != 0) printf(s25er,8);
642
   }
643
 
644
   /* In addition, the same escapes described for character constants
645
      may be used.                                            */
646
 
647
   s = "\n\t\b\r\f\\\'";
648
 
649
   if( s[0] != '\n'
650
    || s[1] != '\t'
651
    || s[2] != '\b'
652
    || s[3] != '\r'
653
    || s[4] != '\f'
654
    || s[5] != '\\'
655
    || s[6] != '\'' ){
656
 
657
     rc = rc+16;
658
     if( pd0->flgd != 0) printf(s25er,16);
659
   }
660
 
661
   /* Finally, a \ and an immediately following newline are ignored */
662
 
663
   s2 = "queep!";
664
   s = "queep!";
665
 
666
   lrc = 0;
667
   for (j=0; j<sizeof "queep!"; j++) if(s[j] != s2[j]) lrc = 1;
668
   if (lrc != 0){
669
     rc = rc+32;
670
     if(pd0->flgd != 0) printf(s25er,32);
671
   }
672
   return rc;
673
}
674
s26(pd0)                  /*  2.6  Hardware Characteristics     */
675
struct defs *pd0;
676
{
677
   static char qs26[8] = "s26    ";
678
   char *ps, *pt;
679
   char c0, c1;
680
   float temp, one, delta;
681
   double tempd, oned;
682
   static char s[] = "%3d bits in %ss.\n";
683
   static char s2[] = "%e is the least number that can be added to 1. (%s).\n";
684
 
685
   ps = qs26;
686
   pt = pd0->rfs;
687
 
688
   while(*pt++ = *ps++);
689
 
690
          /* Here, we shake the machinery a little to see what falls
691
             out.  First, we find out how many bits are in a char.  */
692
 
693
   pd0->cbits = 0;
694
   c0 = 0;
695
   c1 = 1;
696
 
697
   while(c0 != c1) {
698
     c1 = c1<<1;
699
     pd0->cbits = pd0->cbits+1;
700
   }
701
          /* That information lets us determine the size of everything else. */
702
 
703
   pd0->ibits = pd0->cbits * sizeof(int);
704
   pd0->sbits = pd0->cbits * sizeof(short);
705
   pd0->lbits = pd0->cbits * sizeof(long);
706
   pd0->ubits = pd0->cbits * sizeof(unsigned);
707
   pd0->fbits = pd0->cbits * sizeof(float);
708
   pd0->dbits = pd0->cbits * sizeof(double);
709
 
710
          /* We have now almost reconstructed the table in section 2.6, the
711
             exception being the range of the floating point hardware.
712
             Now there are just so many ways to conjure up a floating point
713
             representation system that it's damned near impossible to guess
714
             what's going on by writing a program to interpret bit patterns.
715
             Further, the information isn't all that useful, if we consider
716
             the fact that machines that won't handle numbers between 10**30
717
             and 10**-30 are very hard to find, and that people playing with
718
             numbers outside that range have a lot more to worry about than
719
             just the capacity of the characteristic.
720
 
721
             A much more useful measure is the precision, which can be ex-
722
             pressed in terms of the smallest number that can be added to
723
             1. without loss of significance. We calculate that here, for
724
             float and double.                       */
725
 
726
   one = 1.;
727
   delta = 1.;
728
   temp = 0.;
729
   while(temp != one) {
730
     temp = one+delta;
731
     delta = delta/2.;
732
   }
733
   pd0->fprec = delta * 4.;
734
   oned = 1.;
735
   delta = 1.;
736
   tempd = 0.;
737
   while(tempd != oned) {
738
     tempd = oned+delta;
739
     delta = delta/2.;
740
   }
741
   pd0->dprec = delta * 4.;
742
 
743
          /* Now, if anyone's interested, we publish the results.       */
744
 
745
   if(pd0->flgm != 0) {
746
     printf(s,pd0->cbits,"char");
747
     printf(s,pd0->ibits,"int");
748
     printf(s,pd0->sbits,"short");
749
     printf(s,pd0->lbits,"long");
750
     printf(s,pd0->ubits,"unsigned");
751
     printf(s,pd0->fbits,"float");
752
     printf(s,pd0->dbits,"double");
753
     printf(s2,pd0->fprec,"float");
754
     printf(s2,pd0->dprec,"double");
755
   }
756
          /* Since we are only exploring and perhaps reporting, but not
757
             testing any features, we cannot return an error code.  */
758
 
759
   return 0;
760
}
761
int extvar;
762
s4(pd0)                    /* 4. What's in a name?             */
763
struct defs *pd0;
764
{
765
   static char s4er[] = "s4,er%d\n";
766
   static char qs4[8] = "s4     ";
767
   char *ps, *pt;
768
   int j, rc;
769
 
770
   short sint;             /* short integer, for size test      */
771
   int pint;               /* plain                             */
772
   long lint;              /* long                              */
773
   unsigned target;
774
   unsigned int mask;
775
 
776
   rc = 0;
777
   ps = qs4;
778
   pt = pd0->rfs;
779
 
780
   while(*pt++ = *ps++);
781
 
782
/*   There are four declarable storage classes: automatic,
783
static, external, and register. Automatic variables have
784
been dealt with extensively thus far, and will not be specif-
785
ically treated in this section. Register variables are treated
786
in section s81.
787
 
788
     Static variables are local to a block, but retain their
789
values upon reentry to a block, even after control has left
790
the block.                                                     */
791
 
792
   for (j=0; j<3; j++)
793
     if(svtest(j) != zero()){
794
       rc = 1;
795
       if(pd0->flgd != 0) printf(s4er,1);
796
     }
797
   ;
798
 
799
/*   External variables exist and retain their values throughout
800
the execution of the entire program, and may be used for comm-
801
unication between functions, even separately compiled functions.
802
                                                                */
803
 
804
   setev();
805
   if(testev() != 0){
806
     rc=rc+2;
807
     if(pd0->flgd != 0) printf(s4er,2);
808
   }
809
/*
810
     Characters have been tested elsewhere (in s243).
811
 
812
     Up to three sizes of integer, declared short int, int, and
813
long int, are available. Longer integers provide no less storage
814
than shorter ones, but implementation may make either short
815
integers, or long integers, or both, equivalent to plain
816
integers.
817
                                                                */
818
 
819
   if(sizeof lint < sizeof pint || sizeof pint < sizeof sint){
820
 
821
     rc = rc+4;
822
     if(pd0->flgd != 0) printf(s4er,4);
823
   }
824
 
825
/*   Unsigned integers, declared unsigned, obey the laws of
826
arithmetic modulo 2**n, where n is the number of bits in the
827
implementation                                                  */
828
 
829
   target = ~0U;
830
   mask = 1;
831
 
832
   for(j=0; j<(sizeof target)*pd0->cbits; j++){
833
 
834
     mask = mask&target;
835
     target = target>>1;
836
   }
837
 
838
   if(mask != 1 || target != 0){
839
 
840
     rc = rc+8;
841
     if(pd0->flgd != 0) printf(s4er,8);
842
   }
843
 
844
   return rc;
845
}
846
svtest(n)
847
int n;
848
{
849
   static k;
850
   int rc;
851
   switch (n) {
852
 
853
     case 0: k = 1978;
854
             rc = 0;
855
             break;
856
 
857
     case 1: if(k != 1978) rc = 1;
858
             else{
859
              k = 1929;
860
              rc = 0;
861
             }
862
             break;
863
 
864
     case 2: if(k != 1929) rc = 1;
865
             else rc = 0;
866
             break;
867
   }
868
   return rc;
869
}
870
zero(){                 /* Returns a value of zero, possibly */
871
   static k;            /* with side effects, as it's called */
872
   int rc;              /* alternately with svtest, above,   */
873
   k = 2;               /* and has the same internal storage */
874
   rc = 0;              /* requirements.                     */
875
   return rc;
876
}
877
testev(){
878
   if(extvar != 1066) return 1;
879
   else return 0;
880
}
881
s61(pd0)          /* Characters and integers */
882
struct defs *pd0;
883
{
884
   static char s61er[] = "s61,er%d\n";
885
   static char qs61[8] = "s61    ";
886
   short from, shortint;
887
   long int to, longint;
888
   int rc, lrc;
889
   int j;
890
   char fromc, charint;
891
   char *wd, *pc[6];
892
 
893
   static char upper_alpha[]             = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
894
   static char lower_alpha[]             = "abcdefghijklmnopqrstuvwxyz";
895
   static char numbers[]               = "0123456789";
896
   static char special_characters[]    = "~!\"#%&()_=-^|{}[]+;*:<>,.?/";
897
   static char extra_special_characters[] = "\n\t\b\r\f\\\'";
898
   static char blank_and_NUL[]            = " \0";
899
 
900
   char *ps, *pt;
901
   ps = qs61;
902
   pt = pd0->rfs;
903
   rc = 0;
904
   while (*pt++ = *ps++);
905
 
906
/*      A character or a short integer may be used wherever
907
an integer may be used. In all cases, the value is converted
908
to integer. This principle is extensively used throughout this
909
program, and will not be explicitly tested here.        */
910
 
911
/*      Conversion of a shorter integer to a longer always
912
involves sign extension.                                */
913
 
914
   from = -19;
915
   to = from;
916
 
917
   if(to != -19){
918
     rc = rc+1;
919
     if(pd0->flgd != 0) printf(s61er,1);
920
   }
921
 
922
/*      It is guaranteed that a member of the standard char-
923
acter set is nonnegative.                               */
924
 
925
   pc[0] = upper_alpha;
926
   pc[1] = lower_alpha;
927
   pc[2] = numbers;
928
   pc[3] = special_characters;
929
   pc[4] = extra_special_characters;
930
   pc[5] = blank_and_NUL;
931
 
932
   lrc = 0;
933
   for (j=0; j<6; j++)
934
     while(*pc[j]) if(*pc[j]++ < 0) lrc =1;
935
 
936
   if(lrc != 0){
937
     rc=rc+2;
938
     if(pd0->flgd != 0) printf(s61er,2);
939
   }
940
 
941
/*      When a longer integer is converted to a shorter or
942
to  a char, it is truncated on the left; excess bits are
943
simply discarded.                                       */
944
 
945
   longint = 1048579;           /* =2**20+3 */
946
   shortint = longint;
947
   charint = longint;
948
 
949
   if((shortint != longint && shortint != 3) ||
950
      (charint  != longint && charint  != 3)) {
951
     rc = rc+8;
952
     if(pd0->flgd != 0) printf(s61er,8);
953
   }
954
 
955
   return rc;
956
}
957
s626(pd0)          /* 6.2 Float and double                  */
958
                   /* 6.3 Floating and integral                 */
959
                   /* 6.4 Pointers and integers                 */
960
                   /* 6.5 Unsigned                              */
961
                   /* 6.6 Arithmetic conversions                */
962
struct defs *pd0;
963
{
964
   static char s626er[] = "s626,er%d\n";
965
   static char qs626[8] = "s626   ";
966
   int rc;
967
   char *ps, *pt;
968
   float eps, f1, f2, f3, f4, f;
969
   long lint1, lint2, l, ls;
970
   char c, t[28], t0;
971
   short s;
972
   int is, i, j;
973
   unsigned u, us;
974
   double d, ds;
975
   ps = qs626;
976
   pt = pd0->rfs;
977
   rc = 0;
978
   while (*pt++ = *ps++);
979
 
980
        /* Conversions of integral values to floating type are
981
        well-behaved.                                           */
982
 
983
   f1 = 1.;
984
   lint1 = 1.;
985
   lint2 = 1.;
986
 
987
   for(j=0;j<pd0->lbits-2;j++){
988
     f1 = f1*2;
989
     lint2 = (lint2<<1)|lint1;
990
   }
991
   f2 = lint2;
992
   f1 = (f1-f2)/f1;
993
   if(f1>2.*pd0->fprec){
994
 
995
     rc = rc+2;
996
     if(pd0->flgd != 0) printf(s626er,2);
997
   }
998
 
999
        /* Pointer-integer combinations are discussed in s74,
1000
        "Additive operators". The unsigned-int combination
1001
        appears below.                                          */
1002
 
1003
   c = 125;
1004
   s = 125;
1005
   i = 125;     is = 15625;
1006
   u = 125;     us = 15625;
1007
   l = 125;     ls = 15625;
1008
   f = 125.;
1009
   d = 125.;    ds = 15625.;
1010
 
1011
   for(j=0;j<28;j++) t[j] = 0;
1012
 
1013
   if(c*c != is) t[ 0] = 1;
1014
   if(s*c != is) t[ 1] = 1;
1015
   if(s*s != is) t[ 2] = 1;
1016
   if(i*c != is) t[ 3] = 1;
1017
   if(i*s != is) t[ 4] = 1;
1018
   if(i*i != is) t[ 5] = 1;
1019
   if(u*c != us) t[ 6] = 1;
1020
   if(u*s != us) t[ 7] = 1;
1021
   if(u*i != us) t[ 8] = 1;
1022
   if(u*u != us) t[ 9] = 1;
1023
   if(l*c != ls) t[10] = 1;
1024
   if(l*s != ls) t[11] = 1;
1025
   if(l*i != ls) t[12] = 1;
1026
   if(l*u != us) t[13] = 1;
1027
   if(l*l != ls) t[14] = 1;
1028
   if(f*c != ds) t[15] = 1;
1029
   if(f*s != ds) t[16] = 1;
1030
   if(f*i != ds) t[17] = 1;
1031
   if(f*u != ds) t[18] = 1;
1032
   if(f*l != ds) t[19] = 1;
1033
   if(f*f != ds) t[20] = 1;
1034
   if(d*c != ds) t[21] = 1;
1035
   if(d*s != ds) t[22] = 1;
1036
   if(d*i != ds) t[23] = 1;
1037
   if(d*u != ds) t[24] = 1;
1038
   if(d*l != ds) t[25] = 1;
1039
   if(d*f != ds) t[26] = 1;
1040
   if(d*d != ds) t[27] = 1;
1041
 
1042
   t0 = 0;
1043
   for(j=0; j<28; j++) t0 = t0+t[j];
1044
 
1045
   if(t0 != 0){
1046
 
1047
     rc = rc+4;
1048
     if(pd0->flgd != 0){
1049
 
1050
       printf(s626er,4);
1051
       printf("   key=");
1052
       for(j=0;j<28;j++) printf("%d",t[j]);
1053
       printf("\n");
1054
     }
1055
   }
1056
 
1057
        /* When an unsigned integer is converted to long,
1058
           the value of the result is the same numerically
1059
           as that of the unsigned integer.               */
1060
 
1061
   l = (unsigned)0100000;
1062
   if((long)l > (unsigned)0100000){
1063
 
1064
      rc = rc+8;
1065
      if(pd0->flgd != 0) printf(s626er,8);
1066
   }
1067
 
1068
   return rc;
1069
}
1070
s71(pd0)          /*         7.1  Primary expressions   */
1071
struct defs *pd0;
1072
{
1073
   static char s71er[] = "s71,er%d\n";
1074
   static char qs71[8] = "s71    ";
1075
   int rc;
1076
   char *ps, *pt;
1077
   static char q = 'q';
1078
   int x[10], McCarthy(), clobber(), a, b, *p;
1079
   ps = qs71;
1080
   pt = pd0->rfs;
1081
   rc = 0;
1082
   while (*pt++ = *ps++);
1083
 
1084
/*   Testing of expressions and operators is quite complicated,
1085
     because (a) problems are apt to surface in queer combinations
1086
     of operators and operands, rather than in isolation,
1087
     and (b) the number of expressions needed to provoke a case
1088
     of improper behaviour may be quite large. Hence, we take the
1089
     following approach: for this section, and for subsequent
1090
     sections through 7.15, we will check the primitive operations
1091
     in isolation, thus verifying that the primitives work,
1092
     after a fashion. The job of testing combinations, we will
1093
     leave to a separate, machine-generated program, to be included
1094
     in the C test package at some later date.
1095
                                                                */
1096
 
1097
/*   A string is a primary expression. The identifier points to
1098
     the first character of a string.
1099
                                                                  */
1100
 
1101
   if(*"queep" != q){
1102
     rc = rc+1;
1103
     if(pd0->flgd  != 0) printf(s71er,1);
1104
   }
1105
/*   A parenthesized expression is a primary expression whose
1106
     type and value are the same as those of the unadorned
1107
     expression.
1108
                                                                */
1109
   if((2+3) != 2+3) {
1110
     rc = rc+2;
1111
     if(pd0->flgd != 0) printf(s71er,2);
1112
   }
1113
 
1114
/*   A primary expression followed by an expression in square
1115
     brackets is a primary expression. The intuitive meaning is
1116
     that of a subscript. The expression E1[E2] is identical
1117
     (by definition) to *((E1)+(E2)).
1118
                                                                */
1119
 
1120
   x[5] = 1942;
1121
   if(x[5] != 1942 || x[5] != *((x)+(5))){
1122
     rc = rc+4;
1123
     if(pd0->flgd != 0) printf(s71er,4);
1124
   }
1125
 
1126
/*   If the various flavors of function calls didn't work, we
1127
     would never have gotten this far; however, we do need to
1128
     show that functions can be recursive...
1129
                                                               */
1130
 
1131
   if ( McCarthy(-5) != 91){
1132
     rc = rc+8;
1133
     if(pd0->flgd != 0) printf(s71er,8);
1134
   }
1135
 
1136
/*   and that argument passing is strictly by value.           */
1137
 
1138
   a = 2;
1139
   b = 3;
1140
   p = &b;
1141
 
1142
   clobber(a,p);
1143
 
1144
   if(a != 2 || b != 2){
1145
     rc = rc+16;
1146
     if(pd0->flgd != 0) printf(s71er,16);
1147
   }
1148
 
1149
/*   Finally, structures and unions are addressed thusly:      */
1150
 
1151
   if(pd0->dprec != (*pd0).dprec){
1152
     rc = rc+32;
1153
     if(pd0->flgd != 0) printf(s71er,32);
1154
   }
1155
 
1156
   return rc;
1157
}
1158
McCarthy(x)
1159
int x;
1160
{
1161
   if(x>100) return x-10;
1162
   else return McCarthy( McCarthy(x+11));
1163
}
1164
clobber(x,y)
1165
int x, *y;
1166
{
1167
   x = 3;
1168
   *y = 2;
1169
}
1170
s714(pd0)          /*  7.14  Assignment operators       */
1171
struct defs *pd0;
1172
{
1173
   static char f[] = "Local error %d.\n";
1174
   static char s714er[] = "s714,er%d\n";
1175
   static char qs714[8] = "s714   ";
1176
   register int prlc, lrc;
1177
   int rc;
1178
   char cl, cr;
1179
   short sl, sr;
1180
   int il, ir;
1181
   long ll, lr;
1182
   unsigned ul, ur;
1183
   float fl, fr;
1184
   double dl, dr;
1185
   char *ps, *pt;
1186
   ps = qs714;
1187
   pt = pd0->rfs;
1188
   rc = 0;
1189
   lrc = 0;
1190
   prlc = pd0->flgl;
1191
   while (*pt++ = *ps++);
1192
 
1193
        /* This section tests the assignment operators.
1194
 
1195
        It is an exhaustive test of all assignment statements
1196
        of the form:
1197
 
1198
                vl op vr
1199
 
1200
        where vl and vr are variables from the set
1201
        {char,short,int,long,unsigned,float,double} and op is
1202
        one of the assignment operators. There are 395 such
1203
        statements.
1204
 
1205
        The initial values for the variables have been chosen
1206
        so that both the initial values and the results will
1207
        "fit" in just about any implementation, and that the re-
1208
        sults will be such that they test for the proper form-
1209
        ation of composite operators, rather than checking for
1210
        the valid operation of those operators' components.
1211
        For example, in checking >>=, we want to verify that
1212
        a right shift and a move take place, rather than
1213
        whether or not there may be some peculiarities about
1214
        the right shift. Such tests have been made previously,
1215
        and to repeat them here would be to throw out a red
1216
        herring.
1217
 
1218
        The table below lists the operators, assignment targets,
1219
        initial values for left and right operands, and the
1220
        expected values of the results.
1221
 
1222
 
1223
          =  +=  -=  *=  /=  %=  >>=  <<=  &=  ^=  |=
1224
char      2   7   3  10   2   1   1    20   8   6  14
1225
short     2   7   3  10   2   1   1    20   8   6  14
1226
int       2   7   3  10   2   1   1    20   8   6  14
1227
long      2   7   3  10   2   1   1    20   8   6  14
1228
unsigned  2   7   3  10   2   1   1    20   8   6  14
1229
float     2   7   3  10 2.5 |             |
1230
double    2   7   3  10 2.5 |             |
1231
                            |             |
1232
initial         (5,2)       |    (5,2)    |  (12,10)
1233
 
1234
        The following machine-generated program reflects the
1235
        tests described in the table.
1236
                                                                */
1237
 
1238
   cl = 5; cr = 2;
1239
   cl = cr;
1240
   if(cl != 2){
1241
     lrc = 1;
1242
     if(prlc) printf(f,lrc);
1243
   }
1244
   cl = 5; sr = 2;
1245
   cl = sr;
1246
   if(cl != 2){
1247
     lrc = 2;
1248
     if(prlc) printf(f,lrc);
1249
   }
1250
   cl = 5; ir = 2;
1251
   cl = ir;
1252
   if(cl != 2){
1253
     lrc = 3;
1254
     if(prlc) printf(f,lrc);
1255
   }
1256
   cl = 5; lr = 2;
1257
   cl = lr;
1258
   if(cl != 2){
1259
     lrc = 4;
1260
     if(prlc) printf(f,lrc);
1261
   }
1262
   cl = 5; ur = 2;
1263
   cl = ur;
1264
   if(cl != 2){
1265
     lrc = 5;
1266
     if(prlc) printf(f,lrc);
1267
   }
1268
   cl = 5; fr = 2;
1269
   cl = fr;
1270
   if(cl != 2){
1271
     lrc = 6;
1272
     if(prlc) printf(f,lrc);
1273
   }
1274
   cl = 5; dr = 2;
1275
   cl = dr;
1276
   if(cl != 2){
1277
     lrc = 7;
1278
     if(prlc) printf(f,lrc);
1279
   }
1280
   sl = 5; cr = 2;
1281
   sl = cr;
1282
   if(sl != 2){
1283
     lrc = 8;
1284
     if(prlc) printf(f,lrc);
1285
   }
1286
   sl = 5; sr = 2;
1287
   sl = sr;
1288
   if(sl != 2){
1289
     lrc = 9;
1290
     if(prlc) printf(f,lrc);
1291
   }
1292
   sl = 5; ir = 2;
1293
   sl = ir;
1294
   if(sl != 2){
1295
     lrc = 10;
1296
     if(prlc) printf(f,lrc);
1297
   }
1298
   sl = 5; lr = 2;
1299
   sl = lr;
1300
   if(sl != 2){
1301
     lrc = 11;
1302
     if(prlc) printf(f,lrc);
1303
   }
1304
   sl = 5; ur = 2;
1305
   sl = ur;
1306
   if(sl != 2){
1307
     lrc = 12;
1308
     if(prlc) printf(f,lrc);
1309
   }
1310
   sl = 5; fr = 2;
1311
   sl = fr;
1312
   if(sl != 2){
1313
     lrc = 13;
1314
     if(prlc) printf(f,lrc);
1315
   }
1316
   sl = 5; dr = 2;
1317
   sl = dr;
1318
   if(sl != 2){
1319
     lrc = 14;
1320
     if(prlc) printf(f,lrc);
1321
   }
1322
   il = 5; cr = 2;
1323
   il = cr;
1324
   if(il != 2){
1325
     lrc = 15;
1326
     if(prlc) printf(f,lrc);
1327
   }
1328
   il = 5; sr = 2;
1329
   il = sr;
1330
   if(il != 2){
1331
     lrc = 16;
1332
     if(prlc) printf(f,lrc);
1333
   }
1334
   il = 5; ir = 2;
1335
   il = ir;
1336
   if(il != 2){
1337
     lrc = 17;
1338
     if(prlc) printf(f,lrc);
1339
   }
1340
   il = 5; lr = 2;
1341
   il = lr;
1342
   if(il != 2){
1343
     lrc = 18;
1344
     if(prlc) printf(f,lrc);
1345
   }
1346
   il = 5; ur = 2;
1347
   il = ur;
1348
   if(il != 2){
1349
     lrc = 19;
1350
     if(prlc) printf(f,lrc);
1351
   }
1352
   il = 5; fr = 2;
1353
   il = fr;
1354
   if(il != 2){
1355
     lrc = 20;
1356
     if(prlc) printf(f,lrc);
1357
   }
1358
   il = 5; dr = 2;
1359
   il = dr;
1360
   if(il != 2){
1361
     lrc = 21;
1362
     if(prlc) printf(f,lrc);
1363
   }
1364
   ll = 5; cr = 2;
1365
   ll = cr;
1366
   if(ll != 2){
1367
     lrc = 22;
1368
     if(prlc) printf(f,lrc);
1369
   }
1370
   ll = 5; sr = 2;
1371
   ll = sr;
1372
   if(ll != 2){
1373
     lrc = 23;
1374
     if(prlc) printf(f,lrc);
1375
   }
1376
   ll = 5; ir = 2;
1377
   ll = ir;
1378
   if(ll != 2){
1379
     lrc = 24;
1380
     if(prlc) printf(f,lrc);
1381
   }
1382
   ll = 5; lr = 2;
1383
   ll = lr;
1384
   if(ll != 2){
1385
     lrc = 25;
1386
     if(prlc) printf(f,lrc);
1387
   }
1388
   ll = 5; ur = 2;
1389
   ll = ur;
1390
   if(ll != 2){
1391
     lrc = 26;
1392
     if(prlc) printf(f,lrc);
1393
   }
1394
   ll = 5; fr = 2;
1395
   ll = fr;
1396
   if(ll != 2){
1397
     lrc = 27;
1398
     if(prlc) printf(f,lrc);
1399
   }
1400
   ll = 5; dr = 2;
1401
   ll = dr;
1402
   if(ll != 2){
1403
     lrc = 28;
1404
     if(prlc) printf(f,lrc);
1405
   }
1406
   ul = 5; cr = 2;
1407
   ul = cr;
1408
   if(ul != 2){
1409
     lrc = 29;
1410
     if(prlc) printf(f,lrc);
1411
   }
1412
   ul = 5; sr = 2;
1413
   ul = sr;
1414
   if(ul != 2){
1415
     lrc = 30;
1416
     if(prlc) printf(f,lrc);
1417
   }
1418
   ul = 5; ir = 2;
1419
   ul = ir;
1420
   if(ul != 2){
1421
     lrc = 31;
1422
     if(prlc) printf(f,lrc);
1423
   }
1424
   ul = 5; lr = 2;
1425
   ul = lr;
1426
   if(ul != 2){
1427
     lrc = 32;
1428
     if(prlc) printf(f,lrc);
1429
   }
1430
   ul = 5; ur = 2;
1431
   ul = ur;
1432
   if(ul != 2){
1433
     lrc = 33;
1434
     if(prlc) printf(f,lrc);
1435
   }
1436
   ul = 5; fr = 2;
1437
   ul = fr;
1438
   if(ul != 2){
1439
     lrc = 34;
1440
     if(prlc) printf(f,lrc);
1441
   }
1442
   ul = 5; dr = 2;
1443
   ul = dr;
1444
   if(ul != 2){
1445
     lrc = 35;
1446
     if(prlc) printf(f,lrc);
1447
   }
1448
   fl = 5; cr = 2;
1449
   fl = cr;
1450
   if(fl != 2){
1451
     lrc = 36;
1452
     if(prlc) printf(f,lrc);
1453
   }
1454
   fl = 5; sr = 2;
1455
   fl = sr;
1456
   if(fl != 2){
1457
     lrc = 37;
1458
     if(prlc) printf(f,lrc);
1459
   }
1460
   fl = 5; ir = 2;
1461
   fl = ir;
1462
   if(fl != 2){
1463
     lrc = 38;
1464
     if(prlc) printf(f,lrc);
1465
   }
1466
   fl = 5; lr = 2;
1467
   fl = lr;
1468
   if(fl != 2){
1469
     lrc = 39;
1470
     if(prlc) printf(f,lrc);
1471
   }
1472
   fl = 5; ur = 2;
1473
   fl = ur;
1474
   if(fl != 2){
1475
     lrc = 40;
1476
     if(prlc) printf(f,lrc);
1477
   }
1478
   fl = 5; fr = 2;
1479
   fl = fr;
1480
   if(fl != 2){
1481
     lrc = 41;
1482
     if(prlc) printf(f,lrc);
1483
   }
1484
   fl = 5; dr = 2;
1485
   fl = dr;
1486
   if(fl != 2){
1487
     lrc = 42;
1488
     if(prlc) printf(f,lrc);
1489
   }
1490
   dl = 5; cr = 2;
1491
   dl = cr;
1492
   if(dl != 2){
1493
     lrc = 43;
1494
     if(prlc) printf(f,lrc);
1495
   }
1496
   dl = 5; sr = 2;
1497
   dl = sr;
1498
   if(dl != 2){
1499
     lrc = 44;
1500
     if(prlc) printf(f,lrc);
1501
   }
1502
   dl = 5; ir = 2;
1503
   dl = ir;
1504
   if(dl != 2){
1505
     lrc = 45;
1506
     if(prlc) printf(f,lrc);
1507
   }
1508
   dl = 5; lr = 2;
1509
   dl = lr;
1510
   if(dl != 2){
1511
     lrc = 46;
1512
     if(prlc) printf(f,lrc);
1513
   }
1514
   dl = 5; ur = 2;
1515
   dl = ur;
1516
   if(dl != 2){
1517
     lrc = 47;
1518
     if(prlc) printf(f,lrc);
1519
   }
1520
   dl = 5; fr = 2;
1521
   dl = fr;
1522
   if(dl != 2){
1523
     lrc = 48;
1524
     if(prlc) printf(f,lrc);
1525
   }
1526
   dl = 5; dr = 2;
1527
   dl = dr;
1528
   if(dl != 2){
1529
     lrc = 49;
1530
     if(prlc) printf(f,lrc);
1531
   }
1532
   cl = 5; cr = 2;
1533
   cl += cr;
1534
   if(cl != 7){
1535
     lrc = 50;
1536
     if(prlc) printf(f,lrc);
1537
   }
1538
   cl = 5; sr = 2;
1539
   cl += sr;
1540
   if(cl != 7){
1541
     lrc = 51;
1542
     if(prlc) printf(f,lrc);
1543
   }
1544
   cl = 5; ir = 2;
1545
   cl += ir;
1546
   if(cl != 7){
1547
     lrc = 52;
1548
     if(prlc) printf(f,lrc);
1549
   }
1550
   cl = 5; lr = 2;
1551
   cl += lr;
1552
   if(cl != 7){
1553
     lrc = 53;
1554
     if(prlc) printf(f,lrc);
1555
   }
1556
   cl = 5; ur = 2;
1557
   cl += ur;
1558
   if(cl != 7){
1559
     lrc = 54;
1560
     if(prlc) printf(f,lrc);
1561
   }
1562
   cl = 5; fr = 2;
1563
   cl += fr;
1564
   if(cl != 7){
1565
     lrc = 55;
1566
     if(prlc) printf(f,lrc);
1567
   }
1568
   cl = 5; dr = 2;
1569
   cl += dr;
1570
   if(cl != 7){
1571
     lrc = 56;
1572
     if(prlc) printf(f,lrc);
1573
   }
1574
   sl = 5; cr = 2;
1575
   sl += cr;
1576
   if(sl != 7){
1577
     lrc = 57;
1578
     if(prlc) printf(f,lrc);
1579
   }
1580
   sl = 5; sr = 2;
1581
   sl += sr;
1582
   if(sl != 7){
1583
     lrc = 58;
1584
     if(prlc) printf(f,lrc);
1585
   }
1586
   sl = 5; ir = 2;
1587
   sl += ir;
1588
   if(sl != 7){
1589
     lrc = 59;
1590
     if(prlc) printf(f,lrc);
1591
   }
1592
   sl = 5; lr = 2;
1593
   sl += lr;
1594
   if(sl != 7){
1595
     lrc = 60;
1596
     if(prlc) printf(f,lrc);
1597
   }
1598
   sl = 5; ur = 2;
1599
   sl += ur;
1600
   if(sl != 7){
1601
     lrc = 61;
1602
     if(prlc) printf(f,lrc);
1603
   }
1604
   sl = 5; fr = 2;
1605
   sl += fr;
1606
   if(sl != 7){
1607
     lrc = 62;
1608
     if(prlc) printf(f,lrc);
1609
   }
1610
   sl = 5; dr = 2;
1611
   sl += dr;
1612
   if(sl != 7){
1613
     lrc = 63;
1614
     if(prlc) printf(f,lrc);
1615
   }
1616
   il = 5; cr = 2;
1617
   il += cr;
1618
   if(il != 7){
1619
     lrc = 64;
1620
     if(prlc) printf(f,lrc);
1621
   }
1622
   il = 5; sr = 2;
1623
   il += sr;
1624
   if(il != 7){
1625
     lrc = 65;
1626
     if(prlc) printf(f,lrc);
1627
   }
1628
   il = 5; ir = 2;
1629
   il += ir;
1630
   if(il != 7){
1631
     lrc = 66;
1632
     if(prlc) printf(f,lrc);
1633
   }
1634
   il = 5; lr = 2;
1635
   il += lr;
1636
   if(il != 7){
1637
     lrc = 67;
1638
     if(prlc) printf(f,lrc);
1639
   }
1640
   il = 5; ur = 2;
1641
   il += ur;
1642
   if(il != 7){
1643
     lrc = 68;
1644
     if(prlc) printf(f,lrc);
1645
   }
1646
   il = 5; fr = 2;
1647
   il += fr;
1648
   if(il != 7){
1649
     lrc = 69;
1650
     if(prlc) printf(f,lrc);
1651
   }
1652
   il = 5; dr = 2;
1653
   il += dr;
1654
   if(il != 7){
1655
     lrc = 70;
1656
     if(prlc) printf(f,lrc);
1657
   }
1658
   ll = 5; cr = 2;
1659
   ll += cr;
1660
   if(ll != 7){
1661
     lrc = 71;
1662
     if(prlc) printf(f,lrc);
1663
   }
1664
   ll = 5; sr = 2;
1665
   ll += sr;
1666
   if(ll != 7){
1667
     lrc = 72;
1668
     if(prlc) printf(f,lrc);
1669
   }
1670
   ll = 5; ir = 2;
1671
   ll += ir;
1672
   if(ll != 7){
1673
     lrc = 73;
1674
     if(prlc) printf(f,lrc);
1675
   }
1676
   ll = 5; lr = 2;
1677
   ll += lr;
1678
   if(ll != 7){
1679
     lrc = 74;
1680
     if(prlc) printf(f,lrc);
1681
   }
1682
   ll = 5; ur = 2;
1683
   ll += ur;
1684
   if(ll != 7){
1685
     lrc = 75;
1686
     if(prlc) printf(f,lrc);
1687
   }
1688
   ll = 5; fr = 2;
1689
   ll += fr;
1690
   if(ll != 7){
1691
     lrc = 76;
1692
     if(prlc) printf(f,lrc);
1693
   }
1694
   ll = 5; dr = 2;
1695
   ll += dr;
1696
   if(ll != 7){
1697
     lrc = 77;
1698
     if(prlc) printf(f,lrc);
1699
   }
1700
   ul = 5; cr = 2;
1701
   ul += cr;
1702
   if(ul != 7){
1703
     lrc = 78;
1704
     if(prlc) printf(f,lrc);
1705
   }
1706
   ul = 5; sr = 2;
1707
   ul += sr;
1708
   if(ul != 7){
1709
     lrc = 79;
1710
     if(prlc) printf(f,lrc);
1711
   }
1712
   ul = 5; ir = 2;
1713
   ul += ir;
1714
   if(ul != 7){
1715
     lrc = 80;
1716
     if(prlc) printf(f,lrc);
1717
   }
1718
   ul = 5; lr = 2;
1719
   ul += lr;
1720
   if(ul != 7){
1721
     lrc = 81;
1722
     if(prlc) printf(f,lrc);
1723
   }
1724
   ul = 5; ur = 2;
1725
   ul += ur;
1726
   if(ul != 7){
1727
     lrc = 82;
1728
     if(prlc) printf(f,lrc);
1729
   }
1730
   ul = 5; fr = 2;
1731
   ul += fr;
1732
   if(ul != 7){
1733
     lrc = 83;
1734
     if(prlc) printf(f,lrc);
1735
   }
1736
   ul = 5; dr = 2;
1737
   ul += dr;
1738
   if(ul != 7){
1739
     lrc = 84;
1740
     if(prlc) printf(f,lrc);
1741
   }
1742
   fl = 5; cr = 2;
1743
   fl += cr;
1744
   if(fl != 7){
1745
     lrc = 85;
1746
     if(prlc) printf(f,lrc);
1747
   }
1748
   fl = 5; sr = 2;
1749
   fl += sr;
1750
   if(fl != 7){
1751
     lrc = 86;
1752
     if(prlc) printf(f,lrc);
1753
   }
1754
   fl = 5; ir = 2;
1755
   fl += ir;
1756
   if(fl != 7){
1757
     lrc = 87;
1758
     if(prlc) printf(f,lrc);
1759
   }
1760
   fl = 5; lr = 2;
1761
   fl += lr;
1762
   if(fl != 7){
1763
     lrc = 88;
1764
     if(prlc) printf(f,lrc);
1765
   }
1766
   fl = 5; ur = 2;
1767
   fl += ur;
1768
   if(fl != 7){
1769
     lrc = 89;
1770
     if(prlc) printf(f,lrc);
1771
   }
1772
   fl = 5; fr = 2;
1773
   fl += fr;
1774
   if(fl != 7){
1775
     lrc = 90;
1776
     if(prlc) printf(f,lrc);
1777
   }
1778
   fl = 5; dr = 2;
1779
   fl += dr;
1780
   if(fl != 7){
1781
     lrc = 91;
1782
     if(prlc) printf(f,lrc);
1783
   }
1784
   dl = 5; cr = 2;
1785
   dl += cr;
1786
   if(dl != 7){
1787
     lrc = 92;
1788
     if(prlc) printf(f,lrc);
1789
   }
1790
   dl = 5; sr = 2;
1791
   dl += sr;
1792
   if(dl != 7){
1793
     lrc = 93;
1794
     if(prlc) printf(f,lrc);
1795
   }
1796
   dl = 5; ir = 2;
1797
   dl += ir;
1798
   if(dl != 7){
1799
     lrc = 94;
1800
     if(prlc) printf(f,lrc);
1801
   }
1802
   dl = 5; lr = 2;
1803
   dl += lr;
1804
   if(dl != 7){
1805
     lrc = 95;
1806
     if(prlc) printf(f,lrc);
1807
   }
1808
   dl = 5; ur = 2;
1809
   dl += ur;
1810
   if(dl != 7){
1811
     lrc = 96;
1812
     if(prlc) printf(f,lrc);
1813
   }
1814
   dl = 5; fr = 2;
1815
   dl += fr;
1816
   if(dl != 7){
1817
     lrc = 97;
1818
     if(prlc) printf(f,lrc);
1819
   }
1820
   dl = 5; dr = 2;
1821
   dl += dr;
1822
   if(dl != 7){
1823
     lrc = 98;
1824
     if(prlc) printf(f,lrc);
1825
   }
1826
   cl = 5; cr = 2;
1827
   cl -= cr;
1828
   if(cl != 3){
1829
     lrc = 99;
1830
     if(prlc) printf(f,lrc);
1831
   }
1832
   cl = 5; sr = 2;
1833
   cl -= sr;
1834
   if(cl != 3){
1835
     lrc = 100;
1836
     if(prlc) printf(f,lrc);
1837
   }
1838
   cl = 5; ir = 2;
1839
   cl -= ir;
1840
   if(cl != 3){
1841
     lrc = 101;
1842
     if(prlc) printf(f,lrc);
1843
   }
1844
   cl = 5; lr = 2;
1845
   cl -= lr;
1846
   if(cl != 3){
1847
     lrc = 102;
1848
     if(prlc) printf(f,lrc);
1849
   }
1850
   cl = 5; ur = 2;
1851
   cl -= ur;
1852
   if(cl != 3){
1853
     lrc = 103;
1854
     if(prlc) printf(f,lrc);
1855
   }
1856
   cl = 5; fr = 2;
1857
   cl -= fr;
1858
   if(cl != 3){
1859
     lrc = 104;
1860
     if(prlc) printf(f,lrc);
1861
   }
1862
   cl = 5; dr = 2;
1863
   cl -= dr;
1864
   if(cl != 3){
1865
     lrc = 105;
1866
     if(prlc) printf(f,lrc);
1867
   }
1868
   sl = 5; cr = 2;
1869
   sl -= cr;
1870
   if(sl != 3){
1871
     lrc = 106;
1872
     if(prlc) printf(f,lrc);
1873
   }
1874
   sl = 5; sr = 2;
1875
   sl -= sr;
1876
   if(sl != 3){
1877
     lrc = 107;
1878
     if(prlc) printf(f,lrc);
1879
   }
1880
   sl = 5; ir = 2;
1881
   sl -= ir;
1882
   if(sl != 3){
1883
     lrc = 108;
1884
     if(prlc) printf(f,lrc);
1885
   }
1886
   sl = 5; lr = 2;
1887
   sl -= lr;
1888
   if(sl != 3){
1889
     lrc = 109;
1890
     if(prlc) printf(f,lrc);
1891
   }
1892
   sl = 5; ur = 2;
1893
   sl -= ur;
1894
   if(sl != 3){
1895
     lrc = 110;
1896
     if(prlc) printf(f,lrc);
1897
   }
1898
   sl = 5; fr = 2;
1899
   sl -= fr;
1900
   if(sl != 3){
1901
     lrc = 111;
1902
     if(prlc) printf(f,lrc);
1903
   }
1904
   sl = 5; dr = 2;
1905
   sl -= dr;
1906
   if(sl != 3){
1907
     lrc = 112;
1908
     if(prlc) printf(f,lrc);
1909
   }
1910
   il = 5; cr = 2;
1911
   il -= cr;
1912
   if(il != 3){
1913
     lrc = 113;
1914
     if(prlc) printf(f,lrc);
1915
   }
1916
   il = 5; sr = 2;
1917
   il -= sr;
1918
   if(il != 3){
1919
     lrc = 114;
1920
     if(prlc) printf(f,lrc);
1921
   }
1922
   il = 5; ir = 2;
1923
   il -= ir;
1924
   if(il != 3){
1925
     lrc = 115;
1926
     if(prlc) printf(f,lrc);
1927
   }
1928
   il = 5; lr = 2;
1929
   il -= lr;
1930
   if(il != 3){
1931
     lrc = 116;
1932
     if(prlc) printf(f,lrc);
1933
   }
1934
   il = 5; ur = 2;
1935
   il -= ur;
1936
   if(il != 3){
1937
     lrc = 117;
1938
     if(prlc) printf(f,lrc);
1939
   }
1940
   il = 5; fr = 2;
1941
   il -= fr;
1942
   if(il != 3){
1943
     lrc = 118;
1944
     if(prlc) printf(f,lrc);
1945
   }
1946
   il = 5; dr = 2;
1947
   il -= dr;
1948
   if(il != 3){
1949
     lrc = 119;
1950
     if(prlc) printf(f,lrc);
1951
   }
1952
   ll = 5; cr = 2;
1953
   ll -= cr;
1954
   if(ll != 3){
1955
     lrc = 120;
1956
     if(prlc) printf(f,lrc);
1957
   }
1958
   ll = 5; sr = 2;
1959
   ll -= sr;
1960
   if(ll != 3){
1961
     lrc = 121;
1962
     if(prlc) printf(f,lrc);
1963
   }
1964
   ll = 5; ir = 2;
1965
   ll -= ir;
1966
   if(ll != 3){
1967
     lrc = 122;
1968
     if(prlc) printf(f,lrc);
1969
   }
1970
   ll = 5; lr = 2;
1971
   ll -= lr;
1972
   if(ll != 3){
1973
     lrc = 123;
1974
     if(prlc) printf(f,lrc);
1975
   }
1976
   ll = 5; ur = 2;
1977
   ll -= ur;
1978
   if(ll != 3){
1979
     lrc = 124;
1980
     if(prlc) printf(f,lrc);
1981
   }
1982
   ll = 5; fr = 2;
1983
   ll -= fr;
1984
   if(ll != 3){
1985
     lrc = 125;
1986
     if(prlc) printf(f,lrc);
1987
   }
1988
   ll = 5; dr = 2;
1989
   ll -= dr;
1990
   if(ll != 3){
1991
     lrc = 126;
1992
     if(prlc) printf(f,lrc);
1993
   }
1994
   ul = 5; cr = 2;
1995
   ul -= cr;
1996
   if(ul != 3){
1997
     lrc = 127;
1998
     if(prlc) printf(f,lrc);
1999
   }
2000
   ul = 5; sr = 2;
2001
   ul -= sr;
2002
   if(ul != 3){
2003
     lrc = 128;
2004
     if(prlc) printf(f,lrc);
2005
   }
2006
   ul = 5; ir = 2;
2007
   ul -= ir;
2008
   if(ul != 3){
2009
     lrc = 129;
2010
     if(prlc) printf(f,lrc);
2011
   }
2012
   ul = 5; lr = 2;
2013
   ul -= lr;
2014
   if(ul != 3){
2015
     lrc = 130;
2016
     if(prlc) printf(f,lrc);
2017
   }
2018
   ul = 5; ur = 2;
2019
   ul -= ur;
2020
   if(ul != 3){
2021
     lrc = 131;
2022
     if(prlc) printf(f,lrc);
2023
   }
2024
   ul = 5; fr = 2;
2025
   ul -= fr;
2026
   if(ul != 3){
2027
     lrc = 132;
2028
     if(prlc) printf(f,lrc);
2029
   }
2030
   ul = 5; dr = 2;
2031
   ul -= dr;
2032
   if(ul != 3){
2033
     lrc = 133;
2034
     if(prlc) printf(f,lrc);
2035
   }
2036
   fl = 5; cr = 2;
2037
   fl -= cr;
2038
   if(fl != 3){
2039
     lrc = 134;
2040
     if(prlc) printf(f,lrc);
2041
   }
2042
   fl = 5; sr = 2;
2043
   fl -= sr;
2044
   if(fl != 3){
2045
     lrc = 135;
2046
     if(prlc) printf(f,lrc);
2047
   }
2048
   fl = 5; ir = 2;
2049
   fl -= ir;
2050
   if(fl != 3){
2051
     lrc = 136;
2052
     if(prlc) printf(f,lrc);
2053
   }
2054
   fl = 5; lr = 2;
2055
   fl -= lr;
2056
   if(fl != 3){
2057
     lrc = 137;
2058
     if(prlc) printf(f,lrc);
2059
   }
2060
   fl = 5; ur = 2;
2061
   fl -= ur;
2062
   if(fl != 3){
2063
     lrc = 138;
2064
     if(prlc) printf(f,lrc);
2065
   }
2066
   fl = 5; fr = 2;
2067
   fl -= fr;
2068
   if(fl != 3){
2069
     lrc = 139;
2070
     if(prlc) printf(f,lrc);
2071
   }
2072
   fl = 5; dr = 2;
2073
   fl -= dr;
2074
   if(fl != 3){
2075
     lrc = 140;
2076
     if(prlc) printf(f,lrc);
2077
   }
2078
   dl = 5; cr = 2;
2079
   dl -= cr;
2080
   if(dl != 3){
2081
     lrc = 141;
2082
     if(prlc) printf(f,lrc);
2083
   }
2084
   dl = 5; sr = 2;
2085
   dl -= sr;
2086
   if(dl != 3){
2087
     lrc = 142;
2088
     if(prlc) printf(f,lrc);
2089
   }
2090
   dl = 5; ir = 2;
2091
   dl -= ir;
2092
   if(dl != 3){
2093
     lrc = 143;
2094
     if(prlc) printf(f,lrc);
2095
   }
2096
   dl = 5; lr = 2;
2097
   dl -= lr;
2098
   if(dl != 3){
2099
     lrc = 144;
2100
     if(prlc) printf(f,lrc);
2101
   }
2102
   dl = 5; ur = 2;
2103
   dl -= ur;
2104
   if(dl != 3){
2105
     lrc = 145;
2106
     if(prlc) printf(f,lrc);
2107
   }
2108
   dl = 5; fr = 2;
2109
   dl -= fr;
2110
   if(dl != 3){
2111
     lrc = 146;
2112
     if(prlc) printf(f,lrc);
2113
   }
2114
   dl = 5; dr = 2;
2115
   dl -= dr;
2116
   if(dl != 3){
2117
     lrc = 147;
2118
     if(prlc) printf(f,lrc);
2119
   }
2120
   cl = 5; cr = 2;
2121
   cl *= cr;
2122
   if(cl != 10){
2123
     lrc = 148;
2124
     if(prlc) printf(f,lrc);
2125
   }
2126
   cl = 5; sr = 2;
2127
   cl *= sr;
2128
   if(cl != 10){
2129
     lrc = 149;
2130
     if(prlc) printf(f,lrc);
2131
   }
2132
   cl = 5; ir = 2;
2133
   cl *= ir;
2134
   if(cl != 10){
2135
     lrc = 150;
2136
     if(prlc) printf(f,lrc);
2137
   }
2138
   cl = 5; lr = 2;
2139
   cl *= lr;
2140
   if(cl != 10){
2141
     lrc = 151;
2142
     if(prlc) printf(f,lrc);
2143
   }
2144
   cl = 5; ur = 2;
2145
   cl *= ur;
2146
   if(cl != 10){
2147
     lrc = 152;
2148
     if(prlc) printf(f,lrc);
2149
   }
2150
   cl = 5; fr = 2;
2151
   cl *= fr;
2152
   if(cl != 10){
2153
     lrc = 153;
2154
     if(prlc) printf(f,lrc);
2155
   }
2156
   cl = 5; dr = 2;
2157
   cl *= dr;
2158
   if(cl != 10){
2159
     lrc = 154;
2160
     if(prlc) printf(f,lrc);
2161
   }
2162
   sl = 5; cr = 2;
2163
   sl *= cr;
2164
   if(sl != 10){
2165
     lrc = 155;
2166
     if(prlc) printf(f,lrc);
2167
   }
2168
   sl = 5; sr = 2;
2169
   sl *= sr;
2170
   if(sl != 10){
2171
     lrc = 156;
2172
     if(prlc) printf(f,lrc);
2173
   }
2174
   sl = 5; ir = 2;
2175
   sl *= ir;
2176
   if(sl != 10){
2177
     lrc = 157;
2178
     if(prlc) printf(f,lrc);
2179
   }
2180
   sl = 5; lr = 2;
2181
   sl *= lr;
2182
   if(sl != 10){
2183
     lrc = 158;
2184
     if(prlc) printf(f,lrc);
2185
   }
2186
   sl = 5; ur = 2;
2187
   sl *= ur;
2188
   if(sl != 10){
2189
     lrc = 159;
2190
     if(prlc) printf(f,lrc);
2191
   }
2192
   sl = 5; fr = 2;
2193
   sl *= fr;
2194
   if(sl != 10){
2195
     lrc = 160;
2196
     if(prlc) printf(f,lrc);
2197
   }
2198
   sl = 5; dr = 2;
2199
   sl *= dr;
2200
   if(sl != 10){
2201
     lrc = 161;
2202
     if(prlc) printf(f,lrc);
2203
   }
2204
   il = 5; cr = 2;
2205
   il *= cr;
2206
   if(il != 10){
2207
     lrc = 162;
2208
     if(prlc) printf(f,lrc);
2209
   }
2210
   il = 5; sr = 2;
2211
   il *= sr;
2212
   if(il != 10){
2213
     lrc = 163;
2214
     if(prlc) printf(f,lrc);
2215
   }
2216
   il = 5; ir = 2;
2217
   il *= ir;
2218
   if(il != 10){
2219
     lrc = 164;
2220
     if(prlc) printf(f,lrc);
2221
   }
2222
   il = 5; lr = 2;
2223
   il *= lr;
2224
   if(il != 10){
2225
     lrc = 165;
2226
     if(prlc) printf(f,lrc);
2227
   }
2228
   il = 5; ur = 2;
2229
   il *= ur;
2230
   if(il != 10){
2231
     lrc = 166;
2232
     if(prlc) printf(f,lrc);
2233
   }
2234
   il = 5; fr = 2;
2235
   il *= fr;
2236
   if(il != 10){
2237
     lrc = 167;
2238
     if(prlc) printf(f,lrc);
2239
   }
2240
   il = 5; dr = 2;
2241
   il *= dr;
2242
   if(il != 10){
2243
     lrc = 168;
2244
     if(prlc) printf(f,lrc);
2245
   }
2246
   ll = 5; cr = 2;
2247
   ll *= cr;
2248
   if(ll != 10){
2249
     lrc = 169;
2250
     if(prlc) printf(f,lrc);
2251
   }
2252
   ll = 5; sr = 2;
2253
   ll *= sr;
2254
   if(ll != 10){
2255
     lrc = 170;
2256
     if(prlc) printf(f,lrc);
2257
   }
2258
   ll = 5; ir = 2;
2259
   ll *= ir;
2260
   if(ll != 10){
2261
     lrc = 171;
2262
     if(prlc) printf(f,lrc);
2263
   }
2264
   ll = 5; lr = 2;
2265
   ll *= lr;
2266
   if(ll != 10){
2267
     lrc = 172;
2268
     if(prlc) printf(f,lrc);
2269
   }
2270
   ll = 5; ur = 2;
2271
   ll *= ur;
2272
   if(ll != 10){
2273
     lrc = 173;
2274
     if(prlc) printf(f,lrc);
2275
   }
2276
   ll = 5; fr = 2;
2277
   ll *= fr;
2278
   if(ll != 10){
2279
     lrc = 174;
2280
     if(prlc) printf(f,lrc);
2281
   }
2282
   ll = 5; dr = 2;
2283
   ll *= dr;
2284
   if(ll != 10){
2285
     lrc = 175;
2286
     if(prlc) printf(f,lrc);
2287
   }
2288
   ul = 5; cr = 2;
2289
   ul *= cr;
2290
   if(ul != 10){
2291
     lrc = 176;
2292
     if(prlc) printf(f,lrc);
2293
   }
2294
   ul = 5; sr = 2;
2295
   ul *= sr;
2296
   if(ul != 10){
2297
     lrc = 177;
2298
     if(prlc) printf(f,lrc);
2299
   }
2300
   ul = 5; ir = 2;
2301
   ul *= ir;
2302
   if(ul != 10){
2303
     lrc = 178;
2304
     if(prlc) printf(f,lrc);
2305
   }
2306
   ul = 5; lr = 2;
2307
   ul *= lr;
2308
   if(ul != 10){
2309
     lrc = 179;
2310
     if(prlc) printf(f,lrc);
2311
   }
2312
   ul = 5; ur = 2;
2313
   ul *= ur;
2314
   if(ul != 10){
2315
     lrc = 180;
2316
     if(prlc) printf(f,lrc);
2317
   }
2318
   ul = 5; fr = 2;
2319
   ul *= fr;
2320
   if(ul != 10){
2321
     lrc = 181;
2322
     if(prlc) printf(f,lrc);
2323
   }
2324
   ul = 5; dr = 2;
2325
   ul *= dr;
2326
   if(ul != 10){
2327
     lrc = 182;
2328
     if(prlc) printf(f,lrc);
2329
   }
2330
   fl = 5; cr = 2;
2331
   fl *= cr;
2332
   if(fl != 10){
2333
     lrc = 183;
2334
     if(prlc) printf(f,lrc);
2335
   }
2336
   fl = 5; sr = 2;
2337
   fl *= sr;
2338
   if(fl != 10){
2339
     lrc = 184;
2340
     if(prlc) printf(f,lrc);
2341
   }
2342
   fl = 5; ir = 2;
2343
   fl *= ir;
2344
   if(fl != 10){
2345
     lrc = 185;
2346
     if(prlc) printf(f,lrc);
2347
   }
2348
   fl = 5; lr = 2;
2349
   fl *= lr;
2350
   if(fl != 10){
2351
     lrc = 186;
2352
     if(prlc) printf(f,lrc);
2353
   }
2354
   fl = 5; ur = 2;
2355
   fl *= ur;
2356
   if(fl != 10){
2357
     lrc = 187;
2358
     if(prlc) printf(f,lrc);
2359
   }
2360
   fl = 5; fr = 2;
2361
   fl *= fr;
2362
   if(fl != 10){
2363
     lrc = 188;
2364
     if(prlc) printf(f,lrc);
2365
   }
2366
   fl = 5; dr = 2;
2367
   fl *= dr;
2368
   if(fl != 10){
2369
     lrc = 189;
2370
     if(prlc) printf(f,lrc);
2371
   }
2372
   dl = 5; cr = 2;
2373
   dl *= cr;
2374
   if(dl != 10){
2375
     lrc = 190;
2376
     if(prlc) printf(f,lrc);
2377
   }
2378
   dl = 5; sr = 2;
2379
   dl *= sr;
2380
   if(dl != 10){
2381
     lrc = 191;
2382
     if(prlc) printf(f,lrc);
2383
   }
2384
   dl = 5; ir = 2;
2385
   dl *= ir;
2386
   if(dl != 10){
2387
     lrc = 192;
2388
     if(prlc) printf(f,lrc);
2389
   }
2390
   dl = 5; lr = 2;
2391
   dl *= lr;
2392
   if(dl != 10){
2393
     lrc = 193;
2394
     if(prlc) printf(f,lrc);
2395
   }
2396
   dl = 5; ur = 2;
2397
   dl *= ur;
2398
   if(dl != 10){
2399
     lrc = 194;
2400
     if(prlc) printf(f,lrc);
2401
   }
2402
   dl = 5; fr = 2;
2403
   dl *= fr;
2404
   if(dl != 10){
2405
     lrc = 195;
2406
     if(prlc) printf(f,lrc);
2407
   }
2408
   dl = 5; dr = 2;
2409
   dl *= dr;
2410
   if(dl != 10){
2411
     lrc = 196;
2412
     if(prlc) printf(f,lrc);
2413
   }
2414
   cl = 5; cr = 2;
2415
   cl /= cr;
2416
   if(cl != 2){
2417
     lrc = 197;
2418
     if(prlc) printf(f,lrc);
2419
   }
2420
   cl = 5; sr = 2;
2421
   cl /= sr;
2422
   if(cl != 2){
2423
     lrc = 198;
2424
     if(prlc) printf(f,lrc);
2425
   }
2426
   cl = 5; ir = 2;
2427
   cl /= ir;
2428
   if(cl != 2){
2429
     lrc = 199;
2430
     if(prlc) printf(f,lrc);
2431
   }
2432
   cl = 5; lr = 2;
2433
   cl /= lr;
2434
   if(cl != 2){
2435
     lrc = 200;
2436
     if(prlc) printf(f,lrc);
2437
   }
2438
   cl = 5; ur = 2;
2439
   cl /= ur;
2440
   if(cl != 2){
2441
     lrc = 201;
2442
     if(prlc) printf(f,lrc);
2443
   }
2444
   cl = 5; fr = 2;
2445
   cl /= fr;
2446
   if(cl != 2){
2447
     lrc = 202;
2448
     if(prlc) printf(f,lrc);
2449
   }
2450
   cl = 5; dr = 2;
2451
   cl /= dr;
2452
   if(cl != 2){
2453
     lrc = 203;
2454
     if(prlc) printf(f,lrc);
2455
   }
2456
   sl = 5; cr = 2;
2457
   sl /= cr;
2458
   if(sl != 2){
2459
     lrc = 204;
2460
     if(prlc) printf(f,lrc);
2461
   }
2462
   sl = 5; sr = 2;
2463
   sl /= sr;
2464
   if(sl != 2){
2465
     lrc = 205;
2466
     if(prlc) printf(f,lrc);
2467
   }
2468
   sl = 5; ir = 2;
2469
   sl /= ir;
2470
   if(sl != 2){
2471
     lrc = 206;
2472
     if(prlc) printf(f,lrc);
2473
   }
2474
   sl = 5; lr = 2;
2475
   sl /= lr;
2476
   if(sl != 2){
2477
     lrc = 207;
2478
     if(prlc) printf(f,lrc);
2479
   }
2480
   sl = 5; ur = 2;
2481
   sl /= ur;
2482
   if(sl != 2){
2483
     lrc = 208;
2484
     if(prlc) printf(f,lrc);
2485
   }
2486
   sl = 5; fr = 2;
2487
   sl /= fr;
2488
   if(sl != 2){
2489
     lrc = 209;
2490
     if(prlc) printf(f,lrc);
2491
   }
2492
   sl = 5; dr = 2;
2493
   sl /= dr;
2494
   if(sl != 2){
2495
     lrc = 210;
2496
     if(prlc) printf(f,lrc);
2497
   }
2498
   il = 5; cr = 2;
2499
   il /= cr;
2500
   if(il != 2){
2501
     lrc = 211;
2502
     if(prlc) printf(f,lrc);
2503
   }
2504
   il = 5; sr = 2;
2505
   il /= sr;
2506
   if(il != 2){
2507
     lrc = 212;
2508
     if(prlc) printf(f,lrc);
2509
   }
2510
   il = 5; ir = 2;
2511
   il /= ir;
2512
   if(il != 2){
2513
     lrc = 213;
2514
     if(prlc) printf(f,lrc);
2515
   }
2516
   il = 5; lr = 2;
2517
   il /= lr;
2518
   if(il != 2){
2519
     lrc = 214;
2520
     if(prlc) printf(f,lrc);
2521
   }
2522
   il = 5; ur = 2;
2523
   il /= ur;
2524
   if(il != 2){
2525
     lrc = 215;
2526
     if(prlc) printf(f,lrc);
2527
   }
2528
   il = 5; fr = 2;
2529
   il /= fr;
2530
   if(il != 2){
2531
     lrc = 216;
2532
     if(prlc) printf(f,lrc);
2533
   }
2534
   il = 5; dr = 2;
2535
   il /= dr;
2536
   if(il != 2){
2537
     lrc = 217;
2538
     if(prlc) printf(f,lrc);
2539
   }
2540
   ll = 5; cr = 2;
2541
   ll /= cr;
2542
   if(ll != 2){
2543
     lrc = 218;
2544
     if(prlc) printf(f,lrc);
2545
   }
2546
   ll = 5; sr = 2;
2547
   ll /= sr;
2548
   if(ll != 2){
2549
     lrc = 219;
2550
     if(prlc) printf(f,lrc);
2551
   }
2552
   ll = 5; ir = 2;
2553
   ll /= ir;
2554
   if(ll != 2){
2555
     lrc = 220;
2556
     if(prlc) printf(f,lrc);
2557
   }
2558
   ll = 5; lr = 2;
2559
   ll /= lr;
2560
   if(ll != 2){
2561
     lrc = 221;
2562
     if(prlc) printf(f,lrc);
2563
   }
2564
   ll = 5; ur = 2;
2565
   ll /= ur;
2566
   if(ll != 2){
2567
     lrc = 222;
2568
     if(prlc) printf(f,lrc);
2569
   }
2570
   ll = 5; fr = 2;
2571
   ll /= fr;
2572
   if(ll != 2){
2573
     lrc = 223;
2574
     if(prlc) printf(f,lrc);
2575
   }
2576
   ll = 5; dr = 2;
2577
   ll /= dr;
2578
   if(ll != 2){
2579
     lrc = 224;
2580
     if(prlc) printf(f,lrc);
2581
   }
2582
   ul = 5; cr = 2;
2583
   ul /= cr;
2584
   if(ul != 2){
2585
     lrc = 225;
2586
     if(prlc) printf(f,lrc);
2587
   }
2588
   ul = 5; sr = 2;
2589
   ul /= sr;
2590
   if(ul != 2){
2591
     lrc = 226;
2592
     if(prlc) printf(f,lrc);
2593
   }
2594
   ul = 5; ir = 2;
2595
   ul /= ir;
2596
   if(ul != 2){
2597
     lrc = 227;
2598
     if(prlc) printf(f,lrc);
2599
   }
2600
   ul = 5; lr = 2;
2601
   ul /= lr;
2602
   if(ul != 2){
2603
     lrc = 228;
2604
     if(prlc) printf(f,lrc);
2605
   }
2606
   ul = 5; ur = 2;
2607
   ul /= ur;
2608
   if(ul != 2){
2609
     lrc = 229;
2610
     if(prlc) printf(f,lrc);
2611
   }
2612
   ul = 5; fr = 2;
2613
   ul /= fr;
2614
   if(ul != 2){
2615
     lrc = 230;
2616
     if(prlc) printf(f,lrc);
2617
   }
2618
   ul = 5; dr = 2;
2619
   ul /= dr;
2620
   if(ul != 2){
2621
     lrc = 231;
2622
     if(prlc) printf(f,lrc);
2623
   }
2624
   fl = 5; cr = 2;
2625
   fl /= cr;
2626
   if(fl != 2.5){
2627
     lrc = 232;
2628
     if(prlc) printf(f,lrc);
2629
   }
2630
   fl = 5; sr = 2;
2631
   fl /= sr;
2632
   if(fl != 2.5){
2633
     lrc = 233;
2634
     if(prlc) printf(f,lrc);
2635
   }
2636
   fl = 5; ir = 2;
2637
   fl /= ir;
2638
   if(fl != 2.5){
2639
     lrc = 234;
2640
     if(prlc) printf(f,lrc);
2641
   }
2642
   fl = 5; lr = 2;
2643
   fl /= lr;
2644
   if(fl != 2.5){
2645
     lrc = 235;
2646
     if(prlc) printf(f,lrc);
2647
   }
2648
   fl = 5; ur = 2;
2649
   fl /= ur;
2650
   if(fl != 2.5){
2651
     lrc = 236;
2652
     if(prlc) printf(f,lrc);
2653
   }
2654
   fl = 5; fr = 2;
2655
   fl /= fr;
2656
   if(fl != 2.5){
2657
     lrc = 237;
2658
     if(prlc) printf(f,lrc);
2659
   }
2660
   fl = 5; dr = 2;
2661
   fl /= dr;
2662
   if(fl != 2.5){
2663
     lrc = 238;
2664
     if(prlc) printf(f,lrc);
2665
   }
2666
   dl = 5; cr = 2;
2667
   dl /= cr;
2668
   if(dl != 2.5){
2669
     lrc = 239;
2670
     if(prlc) printf(f,lrc);
2671
   }
2672
   dl = 5; sr = 2;
2673
   dl /= sr;
2674
   if(dl != 2.5){
2675
     lrc = 240;
2676
     if(prlc) printf(f,lrc);
2677
   }
2678
   dl = 5; ir = 2;
2679
   dl /= ir;
2680
   if(dl != 2.5){
2681
     lrc = 241;
2682
     if(prlc) printf(f,lrc);
2683
   }
2684
   dl = 5; lr = 2;
2685
   dl /= lr;
2686
   if(dl != 2.5){
2687
     lrc = 242;
2688
     if(prlc) printf(f,lrc);
2689
   }
2690
   dl = 5; ur = 2;
2691
   dl /= ur;
2692
   if(dl != 2.5){
2693
     lrc = 243;
2694
     if(prlc) printf(f,lrc);
2695
   }
2696
   dl = 5; fr = 2;
2697
   dl /= fr;
2698
   if(dl != 2.5){
2699
     lrc = 244;
2700
     if(prlc) printf(f,lrc);
2701
   }
2702
   dl = 5; dr = 2;
2703
   dl /= dr;
2704
   if(dl != 2.5){
2705
     lrc = 245;
2706
     if(prlc) printf(f,lrc);
2707
   }
2708
   cl = 5; cr = 2;
2709
   cl %= cr;
2710
   if(cl != 1){
2711
     lrc = 246;
2712
     if(prlc) printf(f,lrc);
2713
   }
2714
   cl = 5; sr = 2;
2715
   cl %= sr;
2716
   if(cl != 1){
2717
     lrc = 247;
2718
     if(prlc) printf(f,lrc);
2719
   }
2720
   cl = 5; ir = 2;
2721
   cl %= ir;
2722
   if(cl != 1){
2723
     lrc = 248;
2724
     if(prlc) printf(f,lrc);
2725
   }
2726
   cl = 5; lr = 2;
2727
   cl %= lr;
2728
   if(cl != 1){
2729
     lrc = 249;
2730
     if(prlc) printf(f,lrc);
2731
   }
2732
   cl = 5; ur = 2;
2733
   cl %= ur;
2734
   if(cl != 1){
2735
     lrc = 250;
2736
     if(prlc) printf(f,lrc);
2737
   }
2738
   sl = 5; cr = 2;
2739
   sl %= cr;
2740
   if(sl != 1){
2741
     lrc = 251;
2742
     if(prlc) printf(f,lrc);
2743
   }
2744
   sl = 5; sr = 2;
2745
   sl %= sr;
2746
   if(sl != 1){
2747
     lrc = 252;
2748
     if(prlc) printf(f,lrc);
2749
   }
2750
   sl = 5; ir = 2;
2751
   sl %= ir;
2752
   if(sl != 1){
2753
     lrc = 253;
2754
     if(prlc) printf(f,lrc);
2755
   }
2756
   sl = 5; lr = 2;
2757
   sl %= lr;
2758
   if(sl != 1){
2759
     lrc = 254;
2760
     if(prlc) printf(f,lrc);
2761
   }
2762
   sl = 5; ur = 2;
2763
   sl %= ur;
2764
   if(sl != 1){
2765
     lrc = 255;
2766
     if(prlc) printf(f,lrc);
2767
   }
2768
   il = 5; cr = 2;
2769
   il %= cr;
2770
   if(il != 1){
2771
     lrc = 256;
2772
     if(prlc) printf(f,lrc);
2773
   }
2774
   il = 5; sr = 2;
2775
   il %= sr;
2776
   if(il != 1){
2777
     lrc = 257;
2778
     if(prlc) printf(f,lrc);
2779
   }
2780
   il = 5; ir = 2;
2781
   il %= ir;
2782
   if(il != 1){
2783
     lrc = 258;
2784
     if(prlc) printf(f,lrc);
2785
   }
2786
   il = 5; lr = 2;
2787
   il %= lr;
2788
   if(il != 1){
2789
     lrc = 259;
2790
     if(prlc) printf(f,lrc);
2791
   }
2792
   il = 5; ur = 2;
2793
   il %= ur;
2794
   if(il != 1){
2795
     lrc = 260;
2796
     if(prlc) printf(f,lrc);
2797
   }
2798
   ll = 5; cr = 2;
2799
   ll %= cr;
2800
   if(ll != 1){
2801
     lrc = 261;
2802
     if(prlc) printf(f,lrc);
2803
   }
2804
   ll = 5; sr = 2;
2805
   ll %= sr;
2806
   if(ll != 1){
2807
     lrc = 262;
2808
     if(prlc) printf(f,lrc);
2809
   }
2810
   ll = 5; ir = 2;
2811
   ll %= ir;
2812
   if(ll != 1){
2813
     lrc = 263;
2814
     if(prlc) printf(f,lrc);
2815
   }
2816
   ll = 5; lr = 2;
2817
   ll %= lr;
2818
   if(ll != 1){
2819
     lrc = 264;
2820
     if(prlc) printf(f,lrc);
2821
   }
2822
   ll = 5; ur = 2;
2823
   ll %= ur;
2824
   if(ll != 1){
2825
     lrc = 265;
2826
     if(prlc) printf(f,lrc);
2827
   }
2828
   ul = 5; cr = 2;
2829
   ul %= cr;
2830
   if(ul != 1){
2831
     lrc = 266;
2832
     if(prlc) printf(f,lrc);
2833
   }
2834
   ul = 5; sr = 2;
2835
   ul %= sr;
2836
   if(ul != 1){
2837
     lrc = 267;
2838
     if(prlc) printf(f,lrc);
2839
   }
2840
   ul = 5; ir = 2;
2841
   ul %= ir;
2842
   if(ul != 1){
2843
     lrc = 268;
2844
     if(prlc) printf(f,lrc);
2845
   }
2846
   ul = 5; lr = 2;
2847
   ul %= lr;
2848
   if(ul != 1){
2849
     lrc = 269;
2850
     if(prlc) printf(f,lrc);
2851
   }
2852
   ul = 5; ur = 2;
2853
   ul %= ur;
2854
   if(ul != 1){
2855
     lrc = 270;
2856
     if(prlc) printf(f,lrc);
2857
   }
2858
   cl = 5; cr = 2;
2859
   cl >>= cr;
2860
   if(cl != 1){
2861
     lrc = 271;
2862
     if(prlc) printf(f,lrc);
2863
   }
2864
   cl = 5; sr = 2;
2865
   cl >>= sr;
2866
   if(cl != 1){
2867
     lrc = 272;
2868
     if(prlc) printf(f,lrc);
2869
   }
2870
   cl = 5; ir = 2;
2871
   cl >>= ir;
2872
   if(cl != 1){
2873
     lrc = 273;
2874
     if(prlc) printf(f,lrc);
2875
   }
2876
   cl = 5; lr = 2;
2877
   cl >>= lr;
2878
   if(cl != 1){
2879
     lrc = 274;
2880
     if(prlc) printf(f,lrc);
2881
   }
2882
   cl = 5; ur = 2;
2883
   cl >>= ur;
2884
   if(cl != 1){
2885
     lrc = 275;
2886
     if(prlc) printf(f,lrc);
2887
   }
2888
   sl = 5; cr = 2;
2889
   sl >>= cr;
2890
   if(sl != 1){
2891
     lrc = 276;
2892
     if(prlc) printf(f,lrc);
2893
   }
2894
   sl = 5; sr = 2;
2895
   sl >>= sr;
2896
   if(sl != 1){
2897
     lrc = 277;
2898
     if(prlc) printf(f,lrc);
2899
   }
2900
   sl = 5; ir = 2;
2901
   sl >>= ir;
2902
   if(sl != 1){
2903
     lrc = 278;
2904
     if(prlc) printf(f,lrc);
2905
   }
2906
   sl = 5; lr = 2;
2907
   sl >>= lr;
2908
   if(sl != 1){
2909
     lrc = 279;
2910
     if(prlc) printf(f,lrc);
2911
   }
2912
   sl = 5; ur = 2;
2913
   sl >>= ur;
2914
   if(sl != 1){
2915
     lrc = 280;
2916
     if(prlc) printf(f,lrc);
2917
   }
2918
   il = 5; cr = 2;
2919
   il >>= cr;
2920
   if(il != 1){
2921
     lrc = 281;
2922
     if(prlc) printf(f,lrc);
2923
   }
2924
   il = 5; sr = 2;
2925
   il >>= sr;
2926
   if(il != 1){
2927
     lrc = 282;
2928
     if(prlc) printf(f,lrc);
2929
   }
2930
   il = 5; ir = 2;
2931
   il >>= ir;
2932
   if(il != 1){
2933
     lrc = 283;
2934
     if(prlc) printf(f,lrc);
2935
   }
2936
   il = 5; lr = 2;
2937
   il >>= lr;
2938
   if(il != 1){
2939
     lrc = 284;
2940
     if(prlc) printf(f,lrc);
2941
   }
2942
   il = 5; ur = 2;
2943
   il >>= ur;
2944
   if(il != 1){
2945
     lrc = 285;
2946
     if(prlc) printf(f,lrc);
2947
   }
2948
   ll = 5; cr = 2;
2949
   ll >>= cr;
2950
   if(ll != 1){
2951
     lrc = 286;
2952
     if(prlc) printf(f,lrc);
2953
   }
2954
   ll = 5; sr = 2;
2955
   ll >>= sr;
2956
   if(ll != 1){
2957
     lrc = 287;
2958
     if(prlc) printf(f,lrc);
2959
   }
2960
   ll = 5; ir = 2;
2961
   ll >>= ir;
2962
   if(ll != 1){
2963
     lrc = 288;
2964
     if(prlc) printf(f,lrc);
2965
   }
2966
   ll = 5; lr = 2;
2967
   ll >>= lr;
2968
   if(ll != 1){
2969
     lrc = 289;
2970
     if(prlc) printf(f,lrc);
2971
   }
2972
   ll = 5; ur = 2;
2973
   ll >>= ur;
2974
   if(ll != 1){
2975
     lrc = 290;
2976
     if(prlc) printf(f,lrc);
2977
   }
2978
   ul = 5; cr = 2;
2979
   ul >>= cr;
2980
   if(ul != 1){
2981
     lrc = 291;
2982
     if(prlc) printf(f,lrc);
2983
   }
2984
   ul = 5; sr = 2;
2985
   ul >>= sr;
2986
   if(ul != 1){
2987
     lrc = 292;
2988
     if(prlc) printf(f,lrc);
2989
   }
2990
   ul = 5; ir = 2;
2991
   ul >>= ir;
2992
   if(ul != 1){
2993
     lrc = 293;
2994
     if(prlc) printf(f,lrc);
2995
   }
2996
   ul = 5; lr = 2;
2997
   ul >>= lr;
2998
   if(ul != 1){
2999
     lrc = 294;
3000
     if(prlc) printf(f,lrc);
3001
   }
3002
   ul = 5; ur = 2;
3003
   ul >>= ur;
3004
   if(ul != 1){
3005
     lrc = 295;
3006
     if(prlc) printf(f,lrc);
3007
   }
3008
   cl = 5; cr = 2;
3009
   cl <<= cr;
3010
   if(cl != 20){
3011
     lrc = 296;
3012
     if(prlc) printf(f,lrc);
3013
   }
3014
   cl = 5; sr = 2;
3015
   cl <<= sr;
3016
   if(cl != 20){
3017
     lrc = 297;
3018
     if(prlc) printf(f,lrc);
3019
   }
3020
   cl = 5; ir = 2;
3021
   cl <<= ir;
3022
   if(cl != 20){
3023
     lrc = 298;
3024
     if(prlc) printf(f,lrc);
3025
   }
3026
   cl = 5; lr = 2;
3027
   cl <<= lr;
3028
   if(cl != 20){
3029
     lrc = 299;
3030
     if(prlc) printf(f,lrc);
3031
   }
3032
   cl = 5; ur = 2;
3033
   cl <<= ur;
3034
   if(cl != 20){
3035
     lrc = 300;
3036
     if(prlc) printf(f,lrc);
3037
   }
3038
   sl = 5; cr = 2;
3039
   sl <<= cr;
3040
   if(sl != 20){
3041
     lrc = 301;
3042
     if(prlc) printf(f,lrc);
3043
   }
3044
   sl = 5; sr = 2;
3045
   sl <<= sr;
3046
   if(sl != 20){
3047
     lrc = 302;
3048
     if(prlc) printf(f,lrc);
3049
   }
3050
   sl = 5; ir = 2;
3051
   sl <<= ir;
3052
   if(sl != 20){
3053
     lrc = 303;
3054
     if(prlc) printf(f,lrc);
3055
   }
3056
   sl = 5; lr = 2;
3057
   sl <<= lr;
3058
   if(sl != 20){
3059
     lrc = 304;
3060
     if(prlc) printf(f,lrc);
3061
   }
3062
   sl = 5; ur = 2;
3063
   sl <<= ur;
3064
   if(sl != 20){
3065
     lrc = 305;
3066
     if(prlc) printf(f,lrc);
3067
   }
3068
   il = 5; cr = 2;
3069
   il <<= cr;
3070
   if(il != 20){
3071
     lrc = 306;
3072
     if(prlc) printf(f,lrc);
3073
   }
3074
   il = 5; sr = 2;
3075
   il <<= sr;
3076
   if(il != 20){
3077
     lrc = 307;
3078
     if(prlc) printf(f,lrc);
3079
   }
3080
   il = 5; ir = 2;
3081
   il <<= ir;
3082
   if(il != 20){
3083
     lrc = 308;
3084
     if(prlc) printf(f,lrc);
3085
   }
3086
   il = 5; lr = 2;
3087
   il <<= lr;
3088
   if(il != 20){
3089
     lrc = 309;
3090
     if(prlc) printf(f,lrc);
3091
   }
3092
   il = 5; ur = 2;
3093
   il <<= ur;
3094
   if(il != 20){
3095
     lrc = 310;
3096
     if(prlc) printf(f,lrc);
3097
   }
3098
   ll = 5; cr = 2;
3099
   ll <<= cr;
3100
   if(ll != 20){
3101
     lrc = 311;
3102
     if(prlc) printf(f,lrc);
3103
   }
3104
   ll = 5; sr = 2;
3105
   ll <<= sr;
3106
   if(ll != 20){
3107
     lrc = 312;
3108
     if(prlc) printf(f,lrc);
3109
   }
3110
   ll = 5; ir = 2;
3111
   ll <<= ir;
3112
   if(ll != 20){
3113
     lrc = 313;
3114
     if(prlc) printf(f,lrc);
3115
   }
3116
   ll = 5; lr = 2;
3117
   ll <<= lr;
3118
   if(ll != 20){
3119
     lrc = 314;
3120
     if(prlc) printf(f,lrc);
3121
   }
3122
   ll = 5; ur = 2;
3123
   ll <<= ur;
3124
   if(ll != 20){
3125
     lrc = 315;
3126
     if(prlc) printf(f,lrc);
3127
   }
3128
   ul = 5; cr = 2;
3129
   ul <<= cr;
3130
   if(ul != 20){
3131
     lrc = 316;
3132
     if(prlc) printf(f,lrc);
3133
   }
3134
   ul = 5; sr = 2;
3135
   ul <<= sr;
3136
   if(ul != 20){
3137
     lrc = 317;
3138
     if(prlc) printf(f,lrc);
3139
   }
3140
   ul = 5; ir = 2;
3141
   ul <<= ir;
3142
   if(ul != 20){
3143
     lrc = 318;
3144
     if(prlc) printf(f,lrc);
3145
   }
3146
   ul = 5; lr = 2;
3147
   ul <<= lr;
3148
   if(ul != 20){
3149
     lrc = 319;
3150
     if(prlc) printf(f,lrc);
3151
   }
3152
   ul = 5; ur = 2;
3153
   ul <<= ur;
3154
   if(ul != 20){
3155
     lrc = 320;
3156
     if(prlc) printf(f,lrc);
3157
   }
3158
   cl = 12; cr = 10;
3159
   cl &= cr;
3160
   if(cl != 8){
3161
     lrc = 321;
3162
     if(prlc) printf(f,lrc);
3163
   }
3164
   cl = 12; sr = 10;
3165
   cl &= sr;
3166
   if(cl != 8){
3167
     lrc = 322;
3168
     if(prlc) printf(f,lrc);
3169
   }
3170
   cl = 12; ir = 10;
3171
   cl &= ir;
3172
   if(cl != 8){
3173
     lrc = 323;
3174
     if(prlc) printf(f,lrc);
3175
   }
3176
   cl = 12; lr = 10;
3177
   cl &= lr;
3178
   if(cl != 8){
3179
     lrc = 324;
3180
     if(prlc) printf(f,lrc);
3181
   }
3182
   cl = 12; ur = 10;
3183
   cl &= ur;
3184
   if(cl != 8){
3185
     lrc = 325;
3186
     if(prlc) printf(f,lrc);
3187
   }
3188
   sl = 12; cr = 10;
3189
   sl &= cr;
3190
   if(sl != 8){
3191
     lrc = 326;
3192
     if(prlc) printf(f,lrc);
3193
   }
3194
   sl = 12; sr = 10;
3195
   sl &= sr;
3196
   if(sl != 8){
3197
     lrc = 327;
3198
     if(prlc) printf(f,lrc);
3199
   }
3200
   sl = 12; ir = 10;
3201
   sl &= ir;
3202
   if(sl != 8){
3203
     lrc = 328;
3204
     if(prlc) printf(f,lrc);
3205
   }
3206
   sl = 12; lr = 10;
3207
   sl &= lr;
3208
   if(sl != 8){
3209
     lrc = 329;
3210
     if(prlc) printf(f,lrc);
3211
   }
3212
   sl = 12; ur = 10;
3213
   sl &= ur;
3214
   if(sl != 8){
3215
     lrc = 330;
3216
     if(prlc) printf(f,lrc);
3217
   }
3218
   il = 12; cr = 10;
3219
   il &= cr;
3220
   if(il != 8){
3221
     lrc = 331;
3222
     if(prlc) printf(f,lrc);
3223
   }
3224
   il = 12; sr = 10;
3225
   il &= sr;
3226
   if(il != 8){
3227
     lrc = 332;
3228
     if(prlc) printf(f,lrc);
3229
   }
3230
   il = 12; ir = 10;
3231
   il &= ir;
3232
   if(il != 8){
3233
     lrc = 333;
3234
     if(prlc) printf(f,lrc);
3235
   }
3236
   il = 12; lr = 10;
3237
   il &= lr;
3238
   if(il != 8){
3239
     lrc = 334;
3240
     if(prlc) printf(f,lrc);
3241
   }
3242
   il = 12; ur = 10;
3243
   il &= ur;
3244
   if(il != 8){
3245
     lrc = 335;
3246
     if(prlc) printf(f,lrc);
3247
   }
3248
   ll = 12; cr = 10;
3249
   ll &= cr;
3250
   if(ll != 8){
3251
     lrc = 336;
3252
     if(prlc) printf(f,lrc);
3253
   }
3254
   ll = 12; sr = 10;
3255
   ll &= sr;
3256
   if(ll != 8){
3257
     lrc = 337;
3258
     if(prlc) printf(f,lrc);
3259
   }
3260
   ll = 12; ir = 10;
3261
   ll &= ir;
3262
   if(ll != 8){
3263
     lrc = 338;
3264
     if(prlc) printf(f,lrc);
3265
   }
3266
   ll = 12; lr = 10;
3267
   ll &= lr;
3268
   if(ll != 8){
3269
     lrc = 339;
3270
     if(prlc) printf(f,lrc);
3271
   }
3272
   ll = 12; ur = 10;
3273
   ll &= ur;
3274
   if(ll != 8){
3275
     lrc = 340;
3276
     if(prlc) printf(f,lrc);
3277
   }
3278
   ul = 12; cr = 10;
3279
   ul &= cr;
3280
   if(ul != 8){
3281
     lrc = 341;
3282
     if(prlc) printf(f,lrc);
3283
   }
3284
   ul = 12; sr = 10;
3285
   ul &= sr;
3286
   if(ul != 8){
3287
     lrc = 342;
3288
     if(prlc) printf(f,lrc);
3289
   }
3290
   ul = 12; ir = 10;
3291
   ul &= ir;
3292
   if(ul != 8){
3293
     lrc = 343;
3294
     if(prlc) printf(f,lrc);
3295
   }
3296
   ul = 12; lr = 10;
3297
   ul &= lr;
3298
   if(ul != 8){
3299
     lrc = 344;
3300
     if(prlc) printf(f,lrc);
3301
   }
3302
   ul = 12; ur = 10;
3303
   ul &= ur;
3304
   if(ul != 8){
3305
     lrc = 345;
3306
     if(prlc) printf(f,lrc);
3307
   }
3308
   cl = 12; cr = 10;
3309
   cl ^= cr;
3310
   if(cl != 6){
3311
     lrc = 346;
3312
     if(prlc) printf(f,lrc);
3313
   }
3314
   cl = 12; sr = 10;
3315
   cl ^= sr;
3316
   if(cl != 6){
3317
     lrc = 347;
3318
     if(prlc) printf(f,lrc);
3319
   }
3320
   cl = 12; ir = 10;
3321
   cl ^= ir;
3322
   if(cl != 6){
3323
     lrc = 348;
3324
     if(prlc) printf(f,lrc);
3325
   }
3326
   cl = 12; lr = 10;
3327
   cl ^= lr;
3328
   if(cl != 6){
3329
     lrc = 349;
3330
     if(prlc) printf(f,lrc);
3331
   }
3332
   cl = 12; ur = 10;
3333
   cl ^= ur;
3334
   if(cl != 6){
3335
     lrc = 350;
3336
     if(prlc) printf(f,lrc);
3337
   }
3338
   sl = 12; cr = 10;
3339
   sl ^= cr;
3340
   if(sl != 6){
3341
     lrc = 351;
3342
     if(prlc) printf(f,lrc);
3343
   }
3344
   sl = 12; sr = 10;
3345
   sl ^= sr;
3346
   if(sl != 6){
3347
     lrc = 352;
3348
     if(prlc) printf(f,lrc);
3349
   }
3350
   sl = 12; ir = 10;
3351
   sl ^= ir;
3352
   if(sl != 6){
3353
     lrc = 353;
3354
     if(prlc) printf(f,lrc);
3355
   }
3356
   sl = 12; lr = 10;
3357
   sl ^= lr;
3358
   if(sl != 6){
3359
     lrc = 354;
3360
     if(prlc) printf(f,lrc);
3361
   }
3362
   sl = 12; ur = 10;
3363
   sl ^= ur;
3364
   if(sl != 6){
3365
     lrc = 355;
3366
     if(prlc) printf(f,lrc);
3367
   }
3368
   il = 12; cr = 10;
3369
   il ^= cr;
3370
   if(il != 6){
3371
     lrc = 356;
3372
     if(prlc) printf(f,lrc);
3373
   }
3374
   il = 12; sr = 10;
3375
   il ^= sr;
3376
   if(il != 6){
3377
     lrc = 357;
3378
     if(prlc) printf(f,lrc);
3379
   }
3380
   il = 12; ir = 10;
3381
   il ^= ir;
3382
   if(il != 6){
3383
     lrc = 358;
3384
     if(prlc) printf(f,lrc);
3385
   }
3386
   il = 12; lr = 10;
3387
   il ^= lr;
3388
   if(il != 6){
3389
     lrc = 359;
3390
     if(prlc) printf(f,lrc);
3391
   }
3392
   il = 12; ur = 10;
3393
   il ^= ur;
3394
   if(il != 6){
3395
     lrc = 360;
3396
     if(prlc) printf(f,lrc);
3397
   }
3398
   ll = 12; cr = 10;
3399
   ll ^= cr;
3400
   if(ll != 6){
3401
     lrc = 361;
3402
     if(prlc) printf(f,lrc);
3403
   }
3404
   ll = 12; sr = 10;
3405
   ll ^= sr;
3406
   if(ll != 6){
3407
     lrc = 362;
3408
     if(prlc) printf(f,lrc);
3409
   }
3410
   ll = 12; ir = 10;
3411
   ll ^= ir;
3412
   if(ll != 6){
3413
     lrc = 363;
3414
     if(prlc) printf(f,lrc);
3415
   }
3416
   ll = 12; lr = 10;
3417
   ll ^= lr;
3418
   if(ll != 6){
3419
     lrc = 364;
3420
     if(prlc) printf(f,lrc);
3421
   }
3422
   ll = 12; ur = 10;
3423
   ll ^= ur;
3424
   if(ll != 6){
3425
     lrc = 365;
3426
     if(prlc) printf(f,lrc);
3427
   }
3428
   ul = 12; cr = 10;
3429
   ul ^= cr;
3430
   if(ul != 6){
3431
     lrc = 366;
3432
     if(prlc) printf(f,lrc);
3433
   }
3434
   ul = 12; sr = 10;
3435
   ul ^= sr;
3436
   if(ul != 6){
3437
     lrc = 367;
3438
     if(prlc) printf(f,lrc);
3439
   }
3440
   ul = 12; ir = 10;
3441
   ul ^= ir;
3442
   if(ul != 6){
3443
     lrc = 368;
3444
     if(prlc) printf(f,lrc);
3445
   }
3446
   ul = 12; lr = 10;
3447
   ul ^= lr;
3448
   if(ul != 6){
3449
     lrc = 369;
3450
     if(prlc) printf(f,lrc);
3451
   }
3452
   ul = 12; ur = 10;
3453
   ul ^= ur;
3454
   if(ul != 6){
3455
     lrc = 370;
3456
     if(prlc) printf(f,lrc);
3457
   }
3458
   cl = 12; cr = 10;
3459
   cl |= cr;
3460
   if(cl != 14){
3461
     lrc = 371;
3462
     if(prlc) printf(f,lrc);
3463
   }
3464
   cl = 12; sr = 10;
3465
   cl |= sr;
3466
   if(cl != 14){
3467
     lrc = 372;
3468
     if(prlc) printf(f,lrc);
3469
   }
3470
   cl = 12; ir = 10;
3471
   cl |= ir;
3472
   if(cl != 14){
3473
     lrc = 373;
3474
     if(prlc) printf(f,lrc);
3475
   }
3476
   cl = 12; lr = 10;
3477
   cl |= lr;
3478
   if(cl != 14){
3479
     lrc = 374;
3480
     if(prlc) printf(f,lrc);
3481
   }
3482
   cl = 12; ur = 10;
3483
   cl |= ur;
3484
   if(cl != 14){
3485
     lrc = 375;
3486
     if(prlc) printf(f,lrc);
3487
   }
3488
   sl = 12; cr = 10;
3489
   sl |= cr;
3490
   if(sl != 14){
3491
     lrc = 376;
3492
     if(prlc) printf(f,lrc);
3493
   }
3494
   sl = 12; sr = 10;
3495
   sl |= sr;
3496
   if(sl != 14){
3497
     lrc = 377;
3498
     if(prlc) printf(f,lrc);
3499
   }
3500
   sl = 12; ir = 10;
3501
   sl |= ir;
3502
   if(sl != 14){
3503
     lrc = 378;
3504
     if(prlc) printf(f,lrc);
3505
   }
3506
   sl = 12; lr = 10;
3507
   sl |= lr;
3508
   if(sl != 14){
3509
     lrc = 379;
3510
     if(prlc) printf(f,lrc);
3511
   }
3512
   sl = 12; ur = 10;
3513
   sl |= ur;
3514
   if(sl != 14){
3515
     lrc = 380;
3516
     if(prlc) printf(f,lrc);
3517
   }
3518
   il = 12; cr = 10;
3519
   il |= cr;
3520
   if(il != 14){
3521
     lrc = 381;
3522
     if(prlc) printf(f,lrc);
3523
   }
3524
   il = 12; sr = 10;
3525
   il |= sr;
3526
   if(il != 14){
3527
     lrc = 382;
3528
     if(prlc) printf(f,lrc);
3529
   }
3530
   il = 12; ir = 10;
3531
   il |= ir;
3532
   if(il != 14){
3533
     lrc = 383;
3534
     if(prlc) printf(f,lrc);
3535
   }
3536
   il = 12; lr = 10;
3537
   il |= lr;
3538
   if(il != 14){
3539
     lrc = 384;
3540
     if(prlc) printf(f,lrc);
3541
   }
3542
   il = 12; ur = 10;
3543
   il |= ur;
3544
   if(il != 14){
3545
     lrc = 385;
3546
     if(prlc) printf(f,lrc);
3547
   }
3548
   ll = 12; cr = 10;
3549
   ll |= cr;
3550
   if(ll != 14){
3551
     lrc = 386;
3552
     if(prlc) printf(f,lrc);
3553
   }
3554
   ll = 12; sr = 10;
3555
   ll |= sr;
3556
   if(ll != 14){
3557
     lrc = 387;
3558
     if(prlc) printf(f,lrc);
3559
   }
3560
   ll = 12; ir = 10;
3561
   ll |= ir;
3562
   if(ll != 14){
3563
     lrc = 388;
3564
     if(prlc) printf(f,lrc);
3565
   }
3566
   ll = 12; lr = 10;
3567
   ll |= lr;
3568
   if(ll != 14){
3569
     lrc = 389;
3570
     if(prlc) printf(f,lrc);
3571
   }
3572
   ll = 12; ur = 10;
3573
   ll |= ur;
3574
   if(ll != 14){
3575
     lrc = 390;
3576
     if(prlc) printf(f,lrc);
3577
   }
3578
   ul = 12; cr = 10;
3579
   ul |= cr;
3580
   if(ul != 14){
3581
     lrc = 391;
3582
     if(prlc) printf(f,lrc);
3583
   }
3584
   ul = 12; sr = 10;
3585
   ul |= sr;
3586
   if(ul != 14){
3587
     lrc = 392;
3588
     if(prlc) printf(f,lrc);
3589
   }
3590
   ul = 12; ir = 10;
3591
   ul |= ir;
3592
   if(ul != 14){
3593
     lrc = 393;
3594
     if(prlc) printf(f,lrc);
3595
   }
3596
   ul = 12; lr = 10;
3597
   ul |= lr;
3598
   if(ul != 14){
3599
     lrc = 394;
3600
     if(prlc) printf(f,lrc);
3601
   }
3602
   ul = 12; ur = 10;
3603
   ul |= ur;
3604
   if(ul != 14){
3605
     lrc = 395;
3606
     if(prlc) printf(f,lrc);
3607
   }
3608
   if(lrc != 0) {
3609
     rc = 1;
3610
     if(pd0->flgd != 0) printf(s714er,1);
3611
   }
3612
   return rc;
3613
}
3614
s715(pd0)          /*  7.15 Comma operator     */
3615
struct defs *pd0;
3616
{
3617
   static char s715er[] = "s715,er%d\n";
3618
   static char qs715[8] = "s715   ";
3619
   int rc;
3620
   char *ps, *pt;
3621
   int a, t, c, i;
3622
   a = c = 0;
3623
   ps = qs715;
3624
   pt = pd0->rfs;
3625
   rc = 0;
3626
   while (*pt++ = *ps++);
3627
 
3628
        /* A pair of expressions separated by a comma is
3629
        evaluated left to right and the value of the left
3630
        expression is discarded.
3631
                                                                */
3632
   i = 1;
3633
   if( i++,i++,i++,i++,++i != 6 ){
3634
     if(pd0->flgd != 0) printf(s715er,1);
3635
     rc = rc+1;
3636
   }
3637
 
3638
        /* In contexts where the comma is given a special mean-
3639
        ing, for example in a list of actual arguments to
3640
        functions (sic) and lists of initializers, the comma
3641
        operator as described in this section can only appear
3642
        in parentheses; for example
3643
 
3644
                f( a, (t=3, t+2), c)
3645
 
3646
        has three arguments, the second of which has the
3647
        value 5.
3648
                                                                */
3649
 
3650
   if(s715f(a, (t=3, t+2), c) != 5){
3651
     if(pd0->flgd != 0) printf(s715er,2);
3652
     rc = rc+2;
3653
   }
3654
   return rc;
3655
}
3656
s715f(x,y,z)
3657
int x, y, z;
3658
{
3659
   return y;
3660
}
3661
s72(pd0)          /*  7.2  Unary operators  */
3662
struct defs *pd0;
3663
{
3664
   static char s72er[] = "s72,er%d\n";
3665
   static char qs72[8] = "s72    ";
3666
   int rc;
3667
   char *ps, *pt;
3668
   int k, j, i, lrc;
3669
   char c;
3670
   short s;
3671
   long l;
3672
   unsigned u;
3673
   double d;
3674
   float f;
3675
   ps = qs72;
3676
   pt = pd0->rfs;
3677
   rc = 0;
3678
   while (*pt++ = *ps++);
3679
 
3680
        /* The *, denoting indirection, and the &, denoting a
3681
        pointer, are duals of each other, and ought to behave as
3682
        such...                                                 */
3683
 
3684
   k = 2;
3685
   if(*&*&k != 2){
3686
     rc = rc+1;
3687
     printf(s72er,1);
3688
   }
3689
 
3690
        /* The unary minus has the conventional meaning.        */
3691
 
3692
   if(k+(-k) != 0){
3693
     rc = rc+2;
3694
     printf(s72er,2);
3695
   }
3696
 
3697
        /*  The negation operator (!) has been thoroughly checked out,
3698
        perhaps more thoroughly than any of the others. The ~ oper-
3699
        ator gets us a ones complement.                         */
3700
 
3701
   k = 0;
3702
   for(j=0;j<pd0->ibits;j++) k = (k<<1)|1;
3703
   if(~k != 0){
3704
     rc = rc+4;
3705
     printf(s72er,4);
3706
   }
3707
 
3708
        /*  Now we look at the ++ and -- operators, which can be
3709
        used in either prefix or suffix form. With side
3710
        effects they're loaded.                                 */
3711
 
3712
   k = 5;
3713
 
3714
   if( ++k != 6 || --k != 5
3715
    || k++ != 5 || k-- != 6
3716
    ||   k != 5 ){
3717
     rc = rc+8;
3718
     printf(s72er,8);
3719
   }
3720
 
3721
        /*  An expression preceded by the parenthesised name of a
3722
        data type causes conversion of the value of the expression
3723
        to the named type. This construction is called a cast.
3724
        Here, we check to see that all of the possible casts and
3725
        their simple combinations are accepted by the compiler,
3726
        and that they all produce a correct result for this sample
3727
        of size one.                                            */
3728
 
3729
   c = 26;  l = 26;  d = 26.;
3730
   s = 26;  u = 26;
3731
   i = 26;  f = 26.;
3732
 
3733
   lrc = 0;
3734
 
3735
   if( (char)s != 26 || (char)i != 26
3736
    || (char)l != 26 || (char)u != 26
3737
    || (char)f != 26 || (char)d != 26 ) lrc = lrc+1;
3738
 
3739
   if( (short)c != 26 || (short)i != 26
3740
    || (short)l != 26 || (short)u != 26
3741
    || (short)f != 26 || (short)d != 26) lrc = lrc+2;
3742
 
3743
   if( (int)c != 26 || (int)s != 26
3744
    || (int)l != 26 || (int)u != 26
3745
    || (int)f != 26 || (int)d != 26 ) lrc = lrc+4;
3746
 
3747
   if( (long)c != 26 || (long)s != 26
3748
    || (long)i != 26 || (long)u != 26
3749
    || (long)f != 26 || (long)d != 26 ) lrc = lrc+8;
3750
 
3751
   if( (unsigned)c != 26 || (unsigned)s != 26
3752
    || (unsigned)i != 26 || (unsigned)l != 26
3753
    || (unsigned)f != 26 || (unsigned)d != 26 ) lrc = lrc+16;
3754
 
3755
   if( (float)c != 26. || (float)s != 26.
3756
    || (float)i != 26. || (float)l != 26.
3757
    || (float)u != 26. || (float)d != 26. ) lrc = lrc+32;
3758
 
3759
   if( (double)c != 26. || (double)s != 26.
3760
    || (double)i != 26. || (double)l != 26.
3761
    || (double)u != 26. || (double)f != 26. ) lrc = lrc+64;
3762
 
3763
   if(lrc != 0){
3764
     rc = rc+16;
3765
         printf(s72er,16);
3766
   }
3767
 
3768
        /*  The sizeof operator has been tested previously.     */
3769
 
3770
   return rc;
3771
}
3772
s757(pd0)          /* 7.5 Shift operators          */
3773
                   /* 7.6 Relational operators     */
3774
                   /* 7.7 Equality operator        */
3775
struct defs *pd0;
3776
{
3777
   static char s757er[] = "s757,er%d\n";
3778
   static char qs757[8] = "s757   ";
3779
   int rc;
3780
   char *ps, *pt;
3781
   int t,lrc,k,j,a,b,c,d,x[16],*p;
3782
   unsigned rs, ls, rt, lt;
3783
   ps = qs757;
3784
   pt = pd0->rfs;
3785
   rc = 0;
3786
   while (*pt++ = *ps++);
3787
 
3788
        /* The shift operators << and >> group left-to-right.
3789
                                                                */
3790
 
3791
   t = 40;
3792
   if(t<<3<<2 != 1280 || t>>3>>2 != 1){
3793
     rc = rc+1;
3794
     if(pd0->flgd != 0) printf(s757er,1);
3795
   }
3796
 
3797
        /* In the following test, an n-bit unsigned consisting
3798
        of all 1s is shifted right (resp. left) k bits, 0<=k<n.
3799
        We expect to find k 0s followed by n-k 1s (resp. n-k 1s
3800
        followed by k 0s). If not, we complain.
3801
                                                                */
3802
 
3803
   lrc = 0;
3804
   for(k=0; k<pd0->ubits; k++){
3805
     rs = 1;
3806
     ls = rs<<(pd0->ubits-1);
3807
 
3808
     rt = 0;
3809
     lt = ~rt>>k;
3810
     rt = ~rt<<k;
3811
 
3812
     for(j=0; j<pd0->ubits;j++){
3813
       if((j<k) != ((rs&rt) == 0) || (j<k) != ((ls&lt) == 0)) lrc = 1;
3814
       rs = rs<<1;
3815
       ls = ls>>1;
3816
     }
3817
   }
3818
 
3819
   if(lrc != 0){
3820
     rc = rc+2;
3821
     if(pd0->flgd != 0) printf(s757er,2);
3822
   }
3823
 
3824
        /* The relational operators group left-to-right, but this
3825
        fact is not very useful; a<b<c does not mean what it
3826
        seems to...
3827
                                                                */
3828
 
3829
   a = 3;
3830
   b = 2;
3831
   c = 1;
3832
 
3833
   if((a<b<c) != 1){
3834
     rc = rc+4;
3835
     if(pd0->flgd != 0) printf(s757er,4);
3836
   }
3837
 
3838
        /* In general, we take note of the fact that if we got this
3839
        far the relational operators have to be working. We test only
3840
        that two pointers may be compared; the result depends on
3841
        the relative locations in the address space of the
3842
        pointed-to objects.
3843
                                                                */
3844
   if( &x[1] == &x[0] ){
3845
     rc = rc+8;
3846
     if(pd0->flgd != 0) printf(s757er,8);
3847
   }
3848
 
3849
   if( &x[1] < &x[0] ) if(pd0->flgm != 0)
3850
     printf("Increasing array elements assigned to decreasing locations\n");
3851
 
3852
        /* a<b == c<d whenever a<b and c<d have the same
3853
        truth value.                                            */
3854
 
3855
   lrc = 0;
3856
 
3857
   for(j=0;j<16;j++) x[j] = 1;
3858
   x[1] = 0;
3859
   x[4] = 0;
3860
   x[6] = 0;
3861
   x[7] = 0;
3862
   x[9] = 0;
3863
   x[13] = 0;
3864
 
3865
   for(a=0;a<2;a++)
3866
     for(b=0;b<2;b++)
3867
       for(c=0;c<2;c++)
3868
         for(d=0;d<2;d++)
3869
           if((a<b==c<d) != x[8*a+4*b+2*c+d] ) lrc = 1;
3870
 
3871
   if(lrc != 0){
3872
     rc = rc+16;
3873
     if(pd0->flgd != 0) printf(s757er,16);
3874
   }
3875
 
3876
        /* A pointer to which zero has been assigned will
3877
        appear to be equal to zero.
3878
                                                                */
3879
 
3880
   p = 0;
3881
 
3882
   if(p != 0){
3883
     rc = rc+32;
3884
     if(pd0->flgd != 0) printf(s757er,32);
3885
   }
3886
 
3887
   return rc;
3888
}
3889
s7813(pd0)          /* 7.8 Bitwise AND operator
3890
                       7.9 Bitwise OR operator
3891
                       7.10 Bitwise exclusive OR operator
3892
                       7.11 Logical AND operator
3893
                       7.12 Logical OR operator
3894
                       7.13 Conditional operator            */
3895
struct defs *pd0;
3896
{
3897
   register int prlc, lrc;
3898
   int i, j, r, zero, one;
3899
   static char fl[] = "Local error %d.\n";
3900
   static char s7813er[] = "s7813,er%d\n";
3901
   static char qs7813[8] = "s7813  ";
3902
   int rc;
3903
   char *ps, *pt;
3904
   ps = qs7813;
3905
   pt = pd0->rfs;
3906
   lrc = 0;
3907
   rc = 0;
3908
   prlc = pd0->flgl;
3909
   while (*pt++ = *ps++);
3910
 
3911
        /* If bitwise AND, OR, and exclusive OR are to cause
3912
        trouble, they will probably do so when they are used in
3913
        an unusual context. The number of contexts in which
3914
        they can be used is infinite, so to save time we select
3915
        a finite subset: the set of all expressions of the form:
3916
 
3917
                item1 op item2
3918
 
3919
        where item1 and item2 are chosen from the set
3920
        {char,short,long,unsigned,int} and op is one of {&,|,^}.
3921
        We will use 12 and 10 as values for the items, as these
3922
        values will fit into all data types on just about any
3923
        imaginable machine, and the results after performing the
3924
        bitwise operations on them are distinct for each operation,
3925
        i.e.,
3926
 
3927
                12 | 10  -> 1100 | 1010  -> 1110 -> 14
3928
                12 ^ 10  -> 1100 ^ 1010  -> 0110 ->  6
3929
                12 & 10  -> 1100 & 1010  -> 1000 ->  8
3930
 
3931
        There are 75 such combinations:
3932
                                                                */
3933
 
3934
   if(((char)12 & (char)10) !=  8) {lrc = 1;
3935
      if(prlc) printf(fl,lrc);}
3936
   if(((char)12 | (char)10) != 14) {lrc = 2;
3937
      if(prlc) printf(fl,lrc);}
3938
   if(((char)12 ^ (char)10) !=  6) {lrc = 3;
3939
      if(prlc) printf(fl,lrc);}
3940
   if(((char)12 & (short)10) !=  8) {lrc = 4;
3941
      if(prlc) printf(fl,lrc);}
3942
   if(((char)12 | (short)10) != 14) {lrc = 5;
3943
      if(prlc) printf(fl,lrc);}
3944
   if(((char)12 ^ (short)10) !=  6) {lrc = 6;
3945
      if(prlc) printf(fl,lrc);}
3946
   if(((char)12 & (long)10) !=  8) {lrc = 7;
3947
      if(prlc) printf(fl,lrc);}
3948
   if(((char)12 | (long)10) != 14) {lrc = 8;
3949
      if(prlc) printf(fl,lrc);}
3950
   if(((char)12 ^ (long)10) !=  6) {lrc = 9;
3951
      if(prlc) printf(fl,lrc);}
3952
   if(((char)12 & (unsigned)10) !=  8) {lrc = 10;
3953
      if(prlc) printf(fl,lrc);}
3954
   if(((char)12 | (unsigned)10) != 14) {lrc = 11;
3955
      if(prlc) printf(fl,lrc);}
3956
   if(((char)12 ^ (unsigned)10) !=  6) {lrc = 12;
3957
      if(prlc) printf(fl,lrc);}
3958
   if(((char)12 & (int)10) !=  8) {lrc = 13;
3959
      if(prlc) printf(fl,lrc);}
3960
   if(((char)12 | (int)10) != 14) {lrc = 14;
3961
      if(prlc) printf(fl,lrc);}
3962
   if(((char)12 ^ (int)10) !=  6) {lrc = 15;
3963
      if(prlc) printf(fl,lrc);}
3964
   if(((short)12 & (char)10) !=  8) {lrc = 16;
3965
      if(prlc) printf(fl,lrc);}
3966
   if(((short)12 | (char)10) != 14) {lrc = 17;
3967
      if(prlc) printf(fl,lrc);}
3968
   if(((short)12 ^ (char)10) !=  6) {lrc = 18;
3969
      if(prlc) printf(fl,lrc);}
3970
   if(((short)12 & (short)10) !=  8) {lrc = 16;
3971
      if(prlc) printf(fl,lrc);}
3972
   if(((short)12 | (short)10) != 14) {lrc = 20;
3973
      if(prlc) printf(fl,lrc);}
3974
   if(((short)12 ^ (short)10) !=  6) {lrc = 21;
3975
      if(prlc) printf(fl,lrc);}
3976
   if(((short)12 & (long)10) !=  8) {lrc = 22;
3977
      if(prlc) printf(fl,lrc);}
3978
   if(((short)12 | (long)10) != 14) {lrc = 23;
3979
      if(prlc) printf(fl,lrc);}
3980
   if(((short)12 ^ (long)10) !=  6) {lrc = 24;
3981
      if(prlc) printf(fl,lrc);}
3982
   if(((short)12 & (unsigned)10) !=  8) {lrc = 25;
3983
      if(prlc) printf(fl,lrc);}
3984
   if(((short)12 | (unsigned)10) != 14) {lrc = 26;
3985
      if(prlc) printf(fl,lrc);}
3986
   if(((short)12 ^ (unsigned)10) !=  6) {lrc = 27;
3987
      if(prlc) printf(fl,lrc);}
3988
   if(((short)12 & (int)10) !=  8) {lrc = 28;
3989
      if(prlc) printf(fl,lrc);}
3990
   if(((short)12 | (int)10) != 14) {lrc = 26;
3991
      if(prlc) printf(fl,lrc);}
3992
   if(((short)12 ^ (int)10) !=  6) {lrc = 30;
3993
      if(prlc) printf(fl,lrc);}
3994
   if(((long)12 & (char)10) !=  8) {lrc = 31;
3995
      if(prlc) printf(fl,lrc);}
3996
   if(((long)12 | (char)10) != 14) {lrc = 32;
3997
      if(prlc) printf(fl,lrc);}
3998
   if(((long)12 ^ (char)10) !=  6) {lrc = 33;
3999
      if(prlc) printf(fl,lrc);}
4000
   if(((long)12 & (short)10) !=  8) {lrc = 34;
4001
      if(prlc) printf(fl,lrc);}
4002
   if(((long)12 | (short)10) != 14) {lrc = 35;
4003
      if(prlc) printf(fl,lrc);}
4004
   if(((long)12 ^ (short)10) !=  6) {lrc = 36;
4005
      if(prlc) printf(fl,lrc);}
4006
   if(((long)12 & (long)10) !=  8) {lrc = 37;
4007
      if(prlc) printf(fl,lrc);}
4008
   if(((long)12 | (long)10) != 14) {lrc = 38;
4009
      if(prlc) printf(fl,lrc);}
4010
   if(((long)12 ^ (long)10) !=  6) {lrc = 39;
4011
      if(prlc) printf(fl,lrc);}
4012
   if(((long)12 & (unsigned)10) !=  8) {lrc = 40;
4013
      if(prlc) printf(fl,lrc);}
4014
   if(((long)12 | (unsigned)10) != 14) {lrc = 41;
4015
      if(prlc) printf(fl,lrc);}
4016
   if(((long)12 ^ (unsigned)10) !=  6) {lrc = 42;
4017
      if(prlc) printf(fl,lrc);}
4018
   if(((long)12 & (int)10) !=  8) {lrc = 43;
4019
      if(prlc) printf(fl,lrc);}
4020
   if(((long)12 | (int)10) != 14) {lrc = 44;
4021
      if(prlc) printf(fl,lrc);}
4022
   if(((long)12 ^ (int)10) !=  6) {lrc = 45;
4023
      if(prlc) printf(fl,lrc);}
4024
   if(((unsigned)12 & (char)10) !=  8) {lrc = 46;
4025
      if(prlc) printf(fl,lrc);}
4026
   if(((unsigned)12 | (char)10) != 14) {lrc = 47;
4027
      if(prlc) printf(fl,lrc);}
4028
   if(((unsigned)12 ^ (char)10) !=  6) {lrc = 48;
4029
      if(prlc) printf(fl,lrc);}
4030
   if(((unsigned)12 & (short)10) !=  8) {lrc = 49;
4031
      if(prlc) printf(fl,lrc);}
4032
   if(((unsigned)12 | (short)10) != 14) {lrc = 50;
4033
      if(prlc) printf(fl,lrc);}
4034
   if(((unsigned)12 ^ (short)10) !=  6) {lrc = 51;
4035
      if(prlc) printf(fl,lrc);}
4036
   if(((unsigned)12 & (long)10) !=  8) {lrc = 52;
4037
      if(prlc) printf(fl,lrc);}
4038
   if(((unsigned)12 | (long)10) != 14) {lrc = 53;
4039
      if(prlc) printf(fl,lrc);}
4040
   if(((unsigned)12 ^ (long)10) !=  6) {lrc = 54;
4041
      if(prlc) printf(fl,lrc);}
4042
   if(((unsigned)12 & (unsigned)10) !=  8) {lrc = 55;
4043
      if(prlc) printf(fl,lrc);}
4044
   if(((unsigned)12 | (unsigned)10) != 14) {lrc = 56;
4045
      if(prlc) printf(fl,lrc);}
4046
   if(((unsigned)12 ^ (unsigned)10) !=  6) {lrc = 57;
4047
      if(prlc) printf(fl,lrc);}
4048
   if(((unsigned)12 & (int)10) !=  8) {lrc = 58;
4049
      if(prlc) printf(fl,lrc);}
4050
   if(((unsigned)12 | (int)10) != 14) {lrc = 56;
4051
      if(prlc) printf(fl,lrc);}
4052
   if(((unsigned)12 ^ (int)10) !=  6) {lrc = 60;
4053
      if(prlc) printf(fl,lrc);}
4054
   if(((int)12 & (char)10) !=  8) {lrc = 61;
4055
      if(prlc) printf(fl,lrc);}
4056
   if(((int)12 | (char)10) != 14) {lrc = 62;
4057
      if(prlc) printf(fl,lrc);}
4058
   if(((int)12 ^ (char)10) !=  6) {lrc = 63;
4059
      if(prlc) printf(fl,lrc);}
4060
   if(((int)12 & (short)10) !=  8) {lrc = 64;
4061
      if(prlc) printf(fl,lrc);}
4062
   if(((int)12 | (short)10) != 14) {lrc = 65;
4063
      if(prlc) printf(fl,lrc);}
4064
   if(((int)12 ^ (short)10) !=  6) {lrc = 66;
4065
      if(prlc) printf(fl,lrc);}
4066
   if(((int)12 & (long)10) !=  8) {lrc = 67;
4067
      if(prlc) printf(fl,lrc);}
4068
   if(((int)12 | (long)10) != 14) {lrc = 68;
4069
      if(prlc) printf(fl,lrc);}
4070
   if(((int)12 ^ (long)10) !=  6) {lrc = 69;
4071
      if(prlc) printf(fl,lrc);}
4072
   if(((int)12 & (unsigned)10) !=  8) {lrc = 70;
4073
      if(prlc) printf(fl,lrc);}
4074
   if(((int)12 | (unsigned)10) != 14) {lrc = 71;
4075
      if(prlc) printf(fl,lrc);}
4076
   if(((int)12 ^ (unsigned)10) !=  6) {lrc = 72;
4077
      if(prlc) printf(fl,lrc);}
4078
   if(((int)12 & (int)10) !=  8) {lrc = 73; if(prlc) printf(fl,lrc);}
4079
   if(((int)12 | (int)10) != 14) {lrc = 74; if(prlc) printf(fl,lrc);}
4080
   if(((int)12 ^ (int)10) !=  6) {lrc = 75; if(prlc) printf(fl,lrc);}
4081
 
4082
   if(lrc != 0){
4083
     if(pd0->flgd != 0) printf(s7813er,1);
4084
     rc = rc+1;
4085
   }
4086
 
4087
        /* The && operator groups left to right. It returns 1
4088
        if both of the operands are nonzero; 0 otherwise.
4089
        It guarantees left to right evaluation; moreover, the
4090
        second operand is not evaluated if the value of the
4091
        first operand is 0.
4092
                                                                */
4093
 
4094
   lrc = 0;
4095
   i = j = 0;
4096
 
4097
   r = i++ && j++;
4098
    if(i!=1) {lrc = 1; if(prlc) printf(fl,lrc);}
4099
    if(j!=0) {lrc = 2; if(prlc) printf(fl,lrc);}
4100
    if(r!=0) {lrc = 3; if(prlc) printf(fl,lrc);}
4101
   r = i && j++;
4102
    if(i!=1) {lrc = 4; if(prlc) printf(fl,lrc);}
4103
    if(j!=1) {lrc = 5; if(prlc) printf(fl,lrc);}
4104
    if(r!=0) {lrc = 6; if(prlc) printf(fl,lrc);}
4105
   r = i-- && j;
4106
    if(i!=0) {lrc = 7; if(prlc) printf(fl,lrc);}
4107
    if(j!=1) {lrc = 8; if(prlc) printf(fl,lrc);}
4108
    if(r!=1) {lrc = 9; if(prlc) printf(fl,lrc);}
4109
   r = i && j--;
4110
    if(i!=0) {lrc = 10; if(prlc) printf(fl,lrc);}
4111
    if(j!=1) {lrc = 11; if(prlc) printf(fl,lrc);}
4112
    if(r!=0) {lrc = 12; if(prlc) printf(fl,lrc);}
4113
 
4114
   if(lrc!=0){
4115
     if(pd0->flgd != 0) printf(s7813er,2);
4116
     rc = rc+2;
4117
   }
4118
 
4119
        /* The || operator groups left to right. It returns 1
4120
        if either of its operands is nonzero; 0 otherwise. It
4121
        guarantees left to right evaluation; moreover, the second
4122
        operand is not evaluated if the value of the first
4123
        operand is nonzero.
4124
                                                                */
4125
 
4126
   lrc = 0;
4127
   i = j = 0;
4128
   r = i++ || j;
4129
    if(i!=1) {lrc = 1; if(prlc) printf(fl,lrc);}
4130
    if(j!=0) {lrc = 2; if(prlc) printf(fl,lrc);}
4131
    if(r!=0) {lrc = 3; if(prlc) printf(fl,lrc);}
4132
   r = j++ || i;
4133
    if(i!=1) {lrc = 4; if(prlc) printf(fl,lrc);}
4134
    if(j!=1) {lrc = 5; if(prlc) printf(fl,lrc);}
4135
    if(r!=1) {lrc = 6; if(prlc) printf(fl,lrc);}
4136
   r = i-- || j--;
4137
    if(i!=0) {lrc = 7; if(prlc) printf(fl,lrc);}
4138
    if(j!=1) {lrc = 8; if(prlc) printf(fl,lrc);}
4139
    if(r!=1) {lrc = 9; if(prlc) printf(fl,lrc);}
4140
   r = i || j--;
4141
    if(i!=0) {lrc = 10; if(prlc) printf(fl,lrc);}
4142
    if(j!=0) {lrc = 11; if(prlc) printf(fl,lrc);}
4143
    if(r!=1) {lrc = 12; if(prlc) printf(fl,lrc);}
4144
 
4145
   if(lrc!=0){
4146
     if(pd0->flgd != 0) printf(s7813er,4);
4147
     rc = rc+4;
4148
   }
4149
 
4150
        /* Conditional expressions group right to left.  */
4151
 
4152
   i = j = 0;
4153
   zero = 0;
4154
   one = 1;
4155
   r = one?zero:one?i++:j++;
4156
   if(r!=0 || i!=0 || j!=0){
4157
     if(pd0->flgd != 0) printf(s7813er,8);
4158
     rc = rc+8;
4159
   }
4160
 
4161
        /* The first expression is evaluated and if it is non-
4162
        zero, the result is the value of the second expression;
4163
        otherwise, that of the third expression.
4164
                                                                */
4165
 
4166
   if((one?zero:1) != 0 || (zero?1:zero) != 0){
4167
     if(pd0->flgd != 0) printf(s7813er,16);
4168
     rc = rc+16;
4169
   }
4170
   return rc;
4171
}
4172
s81(pd0)              /* 8.1 Storage Class Specifiers    */
4173
struct defs *pd0;
4174
{
4175
   static char s81er[] = "s81,er%d\n";
4176
   static char qs81[8] = "s81    ";
4177
   char *ps, *pt;
4178
   int k, rc, j, crc, prc, irc;
4179
   register char rchar;
4180
            char nrchar;
4181
   register int *rptr;
4182
            int *nrptr;
4183
   register int rint;
4184
            int nrint;
4185
   static char badtest[] = "Register count for %s is unreliable.\n";
4186
   static char goodtest[] = "%d registers assigned to %s variables.\n";
4187
 
4188
   rc = 0;
4189
   crc = 0;
4190
   prc = 0;
4191
   irc = 0;
4192
   ps = qs81;
4193
   pt = pd0->rfs;
4194
 
4195
   while(*pt++ = *ps++);
4196
 
4197
/*    The storage class specifiers are:
4198
 
4199
        auto
4200
        static
4201
        extern
4202
        register
4203
        typedef
4204
 
4205
      The first three of these were treated earlier, in s4. The last
4206
   will be checked in s88. "Register" remains.
4207
 
4208
      There are three flavors of register, viz., char, int and pointer.
4209
   We wish first to ascertain that the representations as register
4210
   are consistent with the corresponding nonregister representations.
4211
                                                                 */
4212
 
4213
   k = 1;
4214
   for (j=0; j<50; j++){
4215
     rchar = k;
4216
     nrchar = k;
4217
     rptr = &k;
4218
     nrptr = &k;
4219
     rint = k;
4220
     nrint = k;
4221
 
4222
     if ( rchar != nrchar ) crc = 1;
4223
     if ( rptr != nrptr ) prc = 1;
4224
     if ( rint != nrint ) irc = 1;
4225
     k = k<<1;
4226
   }
4227
 
4228
   if ( crc != 0 ) {
4229
     rc = rc+1;
4230
     if( pd0 -> flgd != 0 ) printf(s81er,1);
4231
   }
4232
 
4233
   if ( prc != 0 ) {
4234
     rc = rc+2;
4235
     if( pd0 -> flgd != 0 ) printf(s81er,2);
4236
   }
4237
 
4238
   if ( irc != 0 ) {
4239
     rc = rc+4;
4240
     if( pd0 -> flgd != 0 ) printf(s81er,4);
4241
   }
4242
 
4243
/*   Now we check to see if variables are actually being assigned
4244
     to registers.                       */
4245
 
4246
   k = regc();
4247
   if ( pd0->flgm != 0 ) {
4248
     if ( k < 0 ) printf(badtest,"char");
4249
     else printf(goodtest,k,"char");
4250
   }
4251
 
4252
   k = regp();
4253
   if ( pd0->flgm != 0 ) {
4254
     if ( k<0 ) printf(badtest,"pointer");
4255
     else printf(goodtest,k,"pointer");
4256
   }
4257
 
4258
   k = regi();
4259
   if ( pd0->flgm != 0 ) {
4260
     if ( k<0 ) printf(badtest,"int");
4261
     else printf(goodtest,k,"int");
4262
   }
4263
 
4264
   return rc;
4265
}
4266
regc() {     /*   char to register assignment   */
4267
/*   Testing a variable whose storage class has been spec-
4268
ified as "register" is somewhat tricky, but it can be done in a
4269
fairly reliable fashion by taking advantage of our knowledge of the
4270
ways in which compilers operate. If we declare a collection of vari-
4271
ables of the same storage class, we would expect that, when storage
4272
for these variables is actually allocated, the variables will be
4273
bunched together and ordered according to one of the following
4274
criteria:
4275
 
4276
     (a) the order in which they were defined.
4277
     (b) the order in which they are used.
4278
     (c) alphabetically.
4279
     (d) the order in which they appear in the compiler's
4280
         symbol table.
4281
     (e) some other way.
4282
 
4283
     Hence, if we define a sequence of variables in close alpha-
4284
betical order, and use them in the same order in which we define
4285
them, we would expect the differences between the addresses of
4286
successive variables to be constant, except in case (d) where the
4287
symbol table is a hash table, or in case (e). If a subsequence in
4288
the middle of this sequence is selected, and for this subsequence,
4289
every other variable is specified to be "register", and address
4290
differences are taken between adjacent nonregister variables, we would
4291
still expect to find constant differences if the "register" vari-
4292
ables were actually assigned to registers, and some other diff-
4293
erences if they were not. Specifically, if we had N variables
4294
specified as "register" of which the first n were actually ass-
4295
igned to registers, we would expect the sequence of differences
4296
to consist of a number of occurrences of some number, followed by
4297
N-n occurrences of some other number, followed by several occurr-
4298
ences of the first number. If we get a sequence like this, we can
4299
determine, by simple subtraction, how many (if any) variables are
4300
being assigned to registers. If we get some other sequence, we know
4301
that the test is invalid.                                     */
4302
 
4303
            char r00;
4304
            char r01;
4305
            char r02;
4306
            char r03;
4307
   register char r04;
4308
            char r05;
4309
   register char r06;
4310
            char r07;
4311
   register char r08;
4312
            char r09;
4313
   register char r10;
4314
            char r11;
4315
   register char r12;
4316
            char r13;
4317
   register char r14;
4318
            char r15;
4319
   register char r16;
4320
            char r17;
4321
   register char r18;
4322
            char r19;
4323
   register char r20;
4324
            char r21;
4325
   register char r22;
4326
            char r23;
4327
   register char r24;
4328
            char r25;
4329
   register char r26;
4330
            char r27;
4331
   register char r28;
4332
            char r29;
4333
   register char r30;
4334
            char r31;
4335
   register char r32;
4336
            char r33;
4337
   register char r34;
4338
            char r35;
4339
            char r36;
4340
            char r37;
4341
            char r38;
4342
 
4343
   int s, n1, n2, nr, j, d[22];
4344
   r00 = 0;
4345
   r01 = 1;
4346
   r02 = 2;
4347
   r03 = 3;
4348
   r04 = 4;
4349
   r05 = 5;
4350
   r06 = 6;
4351
   r07 = 7;
4352
   r08 = 8;
4353
   r09 = 9;
4354
   r10 = 10;
4355
   r11 = 11;
4356
   r12 = 12;
4357
   r13 = 13;
4358
   r14 = 14;
4359
   r15 = 15;
4360
   r16 = 16;
4361
   r17 = 17;
4362
   r18 = 18;
4363
   r19 = 19;
4364
   r20 = 20;
4365
   r21 = 21;
4366
   r22 = 22;
4367
   r23 = 23;
4368
   r24 = 24;
4369
   r25 = 25;
4370
   r26 = 26;
4371
   r27 = 27;
4372
   r28 = 28;
4373
   r29 = 29;
4374
   r30 = 30;
4375
   r31 = 31;
4376
   r32 = 32;
4377
   r33 = 33;
4378
   r34 = 34;
4379
   r35 = 35;
4380
   r36 = 36;
4381
   r37 = 37;
4382
   r38 = 38;
4383
 
4384
   d[0] = &r01 - &r00;
4385
   d[1] = &r02 - &r01;
4386
   d[2] = &r03 - &r02;
4387
   d[3] = &r05 - &r03;
4388
   d[4] = &r07 - &r05;
4389
   d[5] = &r09 - &r07;
4390
   d[6] = &r11 - &r09;
4391
   d[7] = &r13 - &r11;
4392
   d[8] = &r15 - &r13;
4393
   d[9] = &r17 - &r15;
4394
   d[10] = &r19 - &r17;
4395
   d[11] = &r21 - &r19;
4396
   d[12] = &r23 - &r21;
4397
   d[13] = &r25 - &r23;
4398
   d[14] = &r27 - &r25;
4399
   d[15] = &r29 - &r27;
4400
   d[16] = &r31 - &r29;
4401
   d[17] = &r33 - &r31;
4402
   d[18] = &r35 - &r33;
4403
   d[19] = &r36 - &r35;
4404
   d[20] = &r37 - &r36;
4405
   d[21] = &r38 - &r37;
4406
 
4407
 
4408
/*   The following FSM analyzes the string of differences. It accepts
4409
strings of the form a+b+a+ and returns 16 minus the number of bs,
4410
which is the number of variables that actually got into registers.
4411
Otherwise it signals rejection by returning -1., indicating that the
4412
test is unreliable.              */
4413
 
4414
   n1 = d[0];
4415
   s = 1;
4416
 
4417
   for (j=0; j<22; j++)
4418
     switch (s) {
4419
       case 1: if (d[j] != n1) {
4420
                n2 = d[j];
4421
                s = 2;
4422
                nr = 1;
4423
               }
4424
               break;
4425
       case 2: if (d[j] == n1) {
4426
                s = 3;
4427
                break;
4428
               }
4429
               if (d[j] == n2) {
4430
                nr = nr+1;
4431
                break;
4432
               }
4433
               s = 4;
4434
               break;
4435
       case 3: if (d[j] != n1) s = 4;
4436
               break;
4437
     }
4438
   ;
4439
 
4440
   if (s == 3) return 16-nr;
4441
   else return -1;
4442
}
4443
regi() {     /*   int to register assignment    */
4444
/*   Testing a variable whose storage class has been spec-
4445
ified as "register" is somewhat tricky, but it can be done in a
4446
fairly reliable fashion by taking advantage of our knowledge of the
4447
ways in which compilers operate. If we declare a collection of vari-
4448
ables of the same storage class, we would expect that, when storage
4449
for these variables is actually allocated, the variables will be
4450
bunched together and ordered according to one of the following
4451
criteria:
4452
 
4453
     (a) the order in which they were defined.
4454
     (b) the order in which they are used.
4455
     (c) alphabetically.
4456
     (d) the order in which they appear in the compiler's
4457
         symbol table.
4458
     (e) some other way.
4459
 
4460
     Hence, if we define a sequence of variables in close alpha-
4461
betical order, and use them in the same order in which we define
4462
them, we would expect the differences between the addresses of
4463
successive variables to be constant, except in case (d) where the
4464
symbol table is a hash table, or in case (e). If a subsequence in
4465
the middle of this sequence is selected, and for this subsequence,
4466
every other variable is specified to be "register", and address
4467
differences are taken between adjacent nonregister variables, we would
4468
still expect to find constant differences if the "register" vari-
4469
ables were actually assigned to registers, and some other diff-
4470
erences if they were not. Specifically, if we had N variables
4471
specified as "register" of which the first n were actually ass-
4472
igned to registers, we would expect the sequence of differences
4473
to consist of a number of occurrences of some number, followed by
4474
N-n occurrences of some other number, followed by several occurr-
4475
ences of the first number. If we get a sequence like this, we can
4476
determine, by simple subtraction, how many (if any) variables are
4477
being assigned to registers. If we get some other sequence, we know
4478
that the test is invalid.                                     */
4479
 
4480
 
4481
            int r00;
4482
            int r01;
4483
            int r02;
4484
            int r03;
4485
   register int r04;
4486
            int r05;
4487
   register int r06;
4488
            int r07;
4489
   register int r08;
4490
            int r09;
4491
   register int r10;
4492
            int r11;
4493
   register int r12;
4494
            int r13;
4495
   register int r14;
4496
            int r15;
4497
   register int r16;
4498
            int r17;
4499
   register int r18;
4500
            int r19;
4501
   register int r20;
4502
            int r21;
4503
   register int r22;
4504
            int r23;
4505
   register int r24;
4506
            int r25;
4507
   register int r26;
4508
            int r27;
4509
   register int r28;
4510
            int r29;
4511
   register int r30;
4512
            int r31;
4513
   register int r32;
4514
            int r33;
4515
   register int r34;
4516
            int r35;
4517
            int r36;
4518
            int r37;
4519
            int r38;
4520
 
4521
   int s, n1, n2, nr, j, d[22];
4522
 
4523
   r00 = 0;
4524
   r01 = 1;
4525
   r02 = 2;
4526
   r03 = 3;
4527
   r04 = 4;
4528
   r05 = 5;
4529
   r06 = 6;
4530
   r07 = 7;
4531
   r08 = 8;
4532
   r09 = 9;
4533
   r10 = 10;
4534
   r11 = 11;
4535
   r12 = 12;
4536
   r13 = 13;
4537
   r14 = 14;
4538
   r15 = 15;
4539
   r16 = 16;
4540
   r17 = 17;
4541
   r18 = 18;
4542
   r19 = 19;
4543
   r20 = 20;
4544
   r21 = 21;
4545
   r22 = 22;
4546
   r23 = 23;
4547
   r24 = 24;
4548
   r25 = 25;
4549
   r26 = 26;
4550
   r27 = 27;
4551
   r28 = 28;
4552
   r29 = 29;
4553
   r30 = 30;
4554
   r31 = 31;
4555
   r32 = 32;
4556
   r33 = 33;
4557
   r34 = 34;
4558
   r35 = 35;
4559
   r36 = 36;
4560
   r37 = 37;
4561
   r38 = 38;
4562
 
4563
   d[0] = &r01 - &r00;
4564
   d[1] = &r02 - &r01;
4565
   d[2] = &r03 - &r02;
4566
   d[3] = &r05 - &r03;
4567
   d[4] = &r07 - &r05;
4568
   d[5] = &r09 - &r07;
4569
   d[6] = &r11 - &r09;
4570
   d[7] = &r13 - &r11;
4571
   d[8] = &r15 - &r13;
4572
   d[9] = &r17 - &r15;
4573
   d[10] = &r19 - &r17;
4574
   d[11] = &r21 - &r19;
4575
   d[12] = &r23 - &r21;
4576
   d[13] = &r25 - &r23;
4577
   d[14] = &r27 - &r25;
4578
   d[15] = &r29 - &r27;
4579
   d[16] = &r31 - &r29;
4580
   d[17] = &r33 - &r31;
4581
   d[18] = &r35 - &r33;
4582
   d[19] = &r36 - &r35;
4583
   d[20] = &r37 - &r36;
4584
   d[21] = &r38 - &r37;
4585
 
4586
 
4587
/*   The following FSM analyzes the string of differences. It accepts
4588
strings of the form a+b+a+ and returns 16 minus the number of bs,
4589
which is the number of variables that actually got into registers.
4590
Otherwise it signals rejection by returning -1., indicating that the
4591
test is unreliable.              */
4592
 
4593
   n1 = d[0];
4594
   s = 1;
4595
 
4596
   for (j=0; j<22; j++)
4597
     switch (s) {
4598
       case 1: if (d[j] != n1) {
4599
                n2 = d[j];
4600
                s = 2;
4601
                nr = 1;
4602
               }
4603
               break;
4604
       case 2: if (d[j] == n1) {
4605
                s = 3;
4606
                break;
4607
               }
4608
               if (d[j] == n2) {
4609
                nr = nr+1;
4610
                break;
4611
               }
4612
               s = 4;
4613
               break;
4614
       case 3: if (d[j] != n1) s = 4;
4615
               break;
4616
     }
4617
   ;
4618
 
4619
   if (s == 3) return 16-nr;
4620
   else return -1;
4621
}
4622
regp() {     /*   pointer to register assignment   */
4623
/*   Testing a variable whose storage class has been spec-
4624
ified as "register" is somewhat tricky, but it can be done in a
4625
fairly reliable fashion by taking advantage of our knowledge of the
4626
ways in which compilers operate. If we declare a collection of vari-
4627
ables of the same storage class, we would expect that, when storage
4628
for these variables is actually allocated, the variables will be
4629
bunched together and ordered according to one of the following
4630
criteria:
4631
 
4632
     (a) the order in which they were defined.
4633
     (b) the order in which they are used.
4634
     (c) alphabetically.
4635
     (d) the order in which they appear in the compiler's
4636
         symbol table.
4637
     (e) some other way.
4638
 
4639
     Hence, if we define a sequence of variables in close alpha-
4640
betical order, and use them in the same order in which we define
4641
them, we would expect the differences between the addresses of
4642
successive variables to be constant, except in case (d) where the
4643
symbol table is a hash table, or in case (e). If a subsequence in
4644
the middle of this sequence is selected, and for this subsequence,
4645
every other variable is specified to be "register", and address
4646
differences are taken between adjacent nonregister variables, we would
4647
still expect to find constant differences if the "register" vari-
4648
ables were actually assigned to registers, and some other diff-
4649
erences if they were not. Specifically, if we had N variables
4650
specified as "register" of which the first n were actually ass-
4651
igned to registers, we would expect the sequence of differences
4652
to consist of a number of occurrences of some number, followed by
4653
N-n occurrences of some other number, followed by several occurr-
4654
ences of the first number. If we get a sequence like this, we can
4655
determine, by simple subtraction, how many (if any) variables are
4656
being assigned to registers. If we get some other sequence, we know
4657
that the test is invalid.                                     */
4658
 
4659
 
4660
            int *r00;
4661
            int *r01;
4662
            int *r02;
4663
            int *r03;
4664
   register int *r04;
4665
            int *r05;
4666
   register int *r06;
4667
            int *r07;
4668
   register int *r08;
4669
            int *r09;
4670
   register int *r10;
4671
            int *r11;
4672
   register int *r12;
4673
            int *r13;
4674
   register int *r14;
4675
            int *r15;
4676
   register int *r16;
4677
            int *r17;
4678
   register int *r18;
4679
            int *r19;
4680
   register int *r20;
4681
            int *r21;
4682
   register int *r22;
4683
            int *r23;
4684
   register int *r24;
4685
            int *r25;
4686
   register int *r26;
4687
            int *r27;
4688
   register int *r28;
4689
            int *r29;
4690
   register int *r30;
4691
            int *r31;
4692
   register int *r32;
4693
            int *r33;
4694
   register int *r34;
4695
            int *r35;
4696
            int *r36;
4697
            int *r37;
4698
            int *r38;
4699
 
4700
   int s, n1, n2, nr, j, d[22];
4701
 
4702
   r00 = (int *)&r00;
4703
   r01 = (int *)&r01;
4704
   r02 = (int *)&r02;
4705
   r03 = (int *)&r03;
4706
   r04 = (int *)&r05;
4707
   r05 = (int *)&r05;
4708
   r06 = (int *)&r07;
4709
   r07 = (int *)&r07;
4710
   r08 = (int *)&r09;
4711
   r09 = (int *)&r09;
4712
   r10 = (int *)&r11;
4713
   r11 = (int *)&r11;
4714
   r12 = (int *)&r13;
4715
   r13 = (int *)&r13;
4716
   r14 = (int *)&r15;
4717
   r15 = (int *)&r15;
4718
   r16 = (int *)&r17;
4719
   r17 = (int *)&r17;
4720
   r18 = (int *)&r19;
4721
   r19 = (int *)&r19;
4722
   r20 = (int *)&r21;
4723
   r21 = (int *)&r21;
4724
   r22 = (int *)&r23;
4725
   r23 = (int *)&r23;
4726
   r24 = (int *)&r25;
4727
   r25 = (int *)&r25;
4728
   r26 = (int *)&r27;
4729
   r27 = (int *)&r27;
4730
   r28 = (int *)&r29;
4731
   r29 = (int *)&r29;
4732
   r30 = (int *)&r31;
4733
   r31 = (int *)&r31;
4734
   r32 = (int *)&r33;
4735
   r33 = (int *)&r33;
4736
   r34 = (int *)&r35;
4737
   r35 = (int *)&r35;
4738
   r36 = (int *)&r36;
4739
   r37 = (int *)&r37;
4740
   r38 = (int *)&r38;
4741
 
4742
   d[0] = &r01 - &r00;
4743
   d[1] = &r02 - &r01;
4744
   d[2] = &r03 - &r02;
4745
   d[3] = &r05 - &r03;
4746
   d[4] = &r07 - &r05;
4747
   d[5] = &r09 - &r07;
4748
   d[6] = &r11 - &r09;
4749
   d[7] = &r13 - &r11;
4750
   d[8] = &r15 - &r13;
4751
   d[9] = &r17 - &r15;
4752
   d[10] = &r19 - &r17;
4753
   d[11] = &r21 - &r19;
4754
   d[12] = &r23 - &r21;
4755
   d[13] = &r25 - &r23;
4756
   d[14] = &r27 - &r25;
4757
   d[15] = &r29 - &r27;
4758
   d[16] = &r31 - &r29;
4759
   d[17] = &r33 - &r31;
4760
   d[18] = &r35 - &r33;
4761
   d[19] = &r36 - &r35;
4762
   d[20] = &r37 - &r36;
4763
   d[21] = &r38 - &r37;
4764
 
4765
 
4766
/*   The following FSM analyzes the string of differences. It accepts
4767
strings of the form a+b+a+ and returns 16 minus the number of bs,
4768
which is the number of variables that actually got into registers.
4769
Otherwise it signals rejection by returning -1., indicating that the
4770
test is unreliable.              */
4771
 
4772
   n1 = d[0];
4773
   s = 1;
4774
   for (j=0; j<22; j++)
4775
     switch (s) {
4776
       case 1: if (d[j] != n1) {
4777
                n2 = d[j];
4778
                s = 2;
4779
                nr = 1;
4780
               }
4781
               break;
4782
       case 2: if (d[j] == n1) {
4783
                s = 3;
4784
                break;
4785
               }
4786
               if (d[j] == n2) {
4787
                nr = nr+1;
4788
                break;
4789
               }
4790
               s = 4;
4791
               break;
4792
       case 3: if (d[j] != n1) s = 4;
4793
               break;
4794
     }
4795
   ;
4796
 
4797
   if (s == 3) return 16-nr;
4798
   else return -1;
4799
}
4800
s84(pd0)          /*  8.4 Meaning of declarators   */
4801
struct defs *pd0;
4802
{
4803
   int *ip, i, *fip(), (*pfi)(), j, k, array(), glork(int);
4804
   static int x3d[3][5][7];
4805
   float fa[17], *afp[17], sum;
4806
   static char s84er[] = "s84,er%d\n";
4807
   static char qs84[8] = "s84    ";
4808
   int rc;
4809
   char *ps, *pt;
4810
   ps = qs84;
4811
   pt = pd0->rfs;
4812
   rc = 0;
4813
   while (*pt++ = *ps++);
4814
 
4815
        /* The more common varieties of declarators have al-
4816
        ready been touched upon, some more than others. It
4817
        is useful to compare *fip() and (*pfi)().
4818
                                                                */
4819
 
4820
   ip = fip(3);
4821
   if(*ip != 3){
4822
     if(pd0->flgd != 0) printf(s84er,1);
4823
     rc = rc+1;
4824
   }
4825
 
4826
   pfi = glork;
4827
   if((*pfi)(4) != 4){
4828
     if(pd0->flgd != 0) printf(s84er,2);
4829
     rc = rc+2;
4830
   }
4831
 
4832
        /* Float fa[17] declares an array of floating point
4833
        numbers, and *afp[17] declares an array of pointers
4834
        to floats.
4835
                                                                */
4836
 
4837
   for(j=0; j<17; j++){
4838
     fa[j] = j;
4839
     afp[j] = &fa[j];
4840
   }
4841
 
4842
   sum = 0.;
4843
   for(j=0; j<17; j++) sum += *afp[j];
4844
   if(sum != 136){
4845
     if(pd0->flgd != 0) printf(s84er,4);
4846
     rc = rc+4;
4847
   }
4848
 
4849
        /*  static int x3d[3][5][7] declares a static three
4850
        dimensional array of integers, with rank 3x5x7.
4851
        In complete detail, x3d is an array of three items;
4852
        each item is an array of five arrays, and each of
4853
        the latter arrays is an array of seven integers.
4854
        Any of the expressions x3d, x3d[i], x3d[i][j],
4855
        and x3d[i][j][k] may reasonably appear in an express-
4856
        ion. The first three have type "array"; the last has
4857
        type int.
4858
                                                                */
4859
 
4860
   for (i=0; i<3; i++)
4861
     for (j=0; j<5; j++)
4862
       for (k=0; k<7; k++)
4863
         x3d[i][j][k] = i*35+j*7+k;
4864
 
4865
   i = 1; j = 2; k = 3;
4866
 
4867
   if( array(x3d,105,0)
4868
      +array(x3d[i],35,35)
4869
      +array(x3d[i][j],7,49)
4870
      +      x3d[i][j][k]-52){
4871
 
4872
      if(pd0->flgd != 0) printf(s84er,8);
4873
      rc = rc+8;
4874
   }
4875
 
4876
   return rc;
4877
}
4878
array(a,size,start)
4879
int a[], size, start;
4880
{
4881
   int i;
4882
   for(i=0; i<size; i++)
4883
     if(a[i] != i+start) return 1;
4884
 
4885
   return 0;
4886
}
4887
int *fip(x)
4888
int x;
4889
{
4890
   static int y;
4891
   y = x;
4892
   return &y;
4893
}
4894
glork(x)
4895
int x;
4896
{return x;}
4897
s85(pd0)          /*  8.5 Structure and union declarations   */
4898
struct defs *pd0;
4899
{
4900
   static char s85er[] = "s85,er%d\n";
4901
   static char qs85[8] = "s85    ";
4902
   int rc;
4903
   char *ps, *pt;
4904
 
4905
   struct tnode {
4906
     char tword[20];
4907
     int count;
4908
     struct tnode *left;
4909
     struct tnode *right;
4910
   };
4911
 
4912
   struct tnode s1, s2, *sp;
4913
 
4914
   struct{
4915
     char cdummy;
4916
     char c;
4917
   } sc;
4918
 
4919
   struct{
4920
     char cdummy;
4921
     short s;
4922
   } ss;
4923
 
4924
   struct{
4925
     char cdummy;
4926
     int i;
4927
   } si;
4928
 
4929
   struct{
4930
     char cdummy;
4931
     long l;
4932
   } sl;
4933
 
4934
   struct{
4935
     char cdummy;
4936
     unsigned u;
4937
   } su;
4938
 
4939
   struct{
4940
     char cdummy;
4941
     float f;
4942
   } sf;
4943
 
4944
   struct{
4945
     char cdummy;
4946
     double d;
4947
   } sd;
4948
 
4949
   int diff[7], j;
4950
 
4951
   static char *type[] = {
4952
     "char",
4953
     "short",
4954
     "int",
4955
     "long",
4956
     "unsigned",
4957
     "float",
4958
     "double"
4959
   };
4960
 
4961
   static char aln[] = " alignment: ";
4962
 
4963
   struct{
4964
     int twobit:2;
4965
     int       :1;
4966
     int threebit:3;
4967
     int onebit:1;
4968
   } s3;
4969
 
4970
   union{
4971
     char u1[30];
4972
     short u2[30];
4973
     int u3[30];
4974
     long u4[30];
4975
     unsigned u5[30];
4976
     float u6[30];
4977
     double u7[30];
4978
   } u0;
4979
 
4980
   ps = qs85;
4981
   pt = pd0->rfs;
4982
   rc = 0;
4983
   while (*pt++ = *ps++);
4984
 
4985
        /* Within a structure, the objects declared have
4986
        addresses which increase as their declarations are
4987
        read left to right.
4988
                                                                */
4989
 
4990
   if( (char *)&s1.count - &s1.tword[0] <= 0
4991
     ||(char *)&s1.left - (char *)&s1.count <= 0
4992
     ||(char *)&s1.right - (char *)&s1.left <= 0){
4993
     if(pd0->flgd != 0) printf(s85er,1);
4994
     rc = rc+1;
4995
   }
4996
 
4997
        /* Each non-field member of a structure begins on an
4998
        addressing boundary appropriate to its type.
4999
                                                                */
5000
 
5001
   diff[0] = &sc.c - &sc.cdummy;
5002
   diff[1] = (char *)&ss.s - &ss.cdummy;
5003
   diff[2] = (char *)&si.i - &si.cdummy;
5004
   diff[3] = (char *)&sl.l - &sl.cdummy;
5005
   diff[4] = (char *)&su.u - &su.cdummy;
5006
   diff[5] = (char *)&sf.f - &sf.cdummy;
5007
   diff[6] = (char *)&sd.d - &sd.cdummy;
5008
 
5009
   if(pd0->flgm != 0)
5010
    for(j=0; j<7; j++)
5011
     printf("%s%s%d\n",type[j],aln,diff[j]);
5012
 
5013
        /* Field specifications are highly implementation de-
5014
        pendent. About the only thing we can do here is to
5015
        check is that the compiler accepts the field constructs,
5016
        and that they seem to work, after a fashion, at
5017
        run time...
5018
                                                                */
5019
 
5020
   s3.threebit = 7;
5021
   s3.twobit = s3.threebit;
5022
   s3.threebit = s3.twobit;
5023
 
5024
   if(s3.threebit != 3){
5025
     if(s3.threebit == -1){
5026
       if(pd0->flgm != 0) printf("Sign extension in fields\n");
5027
     }
5028
     else{
5029
       if(pd0->flgd != 0) printf(s85er,2);
5030
       rc = rc+2;
5031
     }
5032
   }
5033
 
5034
   s3.onebit = 1;
5035
   if(s3.onebit != 1){
5036
     if(pd0->flgm != 0)
5037
      printf("Be especially careful with 1-bit fields!\n");
5038
   }
5039
 
5040
        /* A union may be thought of as a structure all of whose
5041
        members begin at offset 0 and whose size is sufficient
5042
        to contain any of its members.
5043
                                                                */
5044
 
5045
   if( (char *)u0.u1 - (char *)&u0 != 0
5046
     ||(char *)u0.u2 - (char *)&u0 != 0
5047
     ||(char *)u0.u3 - (char *)&u0 != 0
5048
     ||(char *)u0.u4 - (char *)&u0 != 0
5049
     ||(char *)u0.u5 - (char *)&u0 != 0
5050
     ||(char *)u0.u6 - (char *)&u0 != 0
5051
     ||(char *)u0.u7 - (char *)&u0 != 0){
5052
 
5053
     if(pd0->flgd != 0) printf(s85er,4);
5054
     rc = rc+4;
5055
   }
5056
 
5057
   if( sizeof u0 < sizeof u0.u1
5058
     ||sizeof u0 < sizeof u0.u2
5059
     ||sizeof u0 < sizeof u0.u3
5060
     ||sizeof u0 < sizeof u0.u4
5061
     ||sizeof u0 < sizeof u0.u5
5062
     ||sizeof u0 < sizeof u0.u6
5063
     ||sizeof u0 < sizeof u0.u7){
5064
 
5065
     if(pd0->flgd != 0) printf(s85er,8);
5066
     rc = rc+8;
5067
   }
5068
 
5069
        /* Finally, we check that the pointers work.            */
5070
 
5071
   s1.right = &s2;
5072
   s2.tword[0] = 2;
5073
   s1.right->tword[0] += 1;
5074
   if(s2.tword[0] != 3){
5075
     if(pd0->flgd != 0) printf(s85er,16);
5076
     rc = rc+16;
5077
   }
5078
   return rc;
5079
}
5080
s86(pd0)          /*  8.6 Initialization  */
5081
struct defs *pd0;
5082
{
5083
   static char s86er[] = "s86,er%d\n";
5084
   static char qs86[8] = "s86    ";
5085
   int lrc, rc;
5086
   char *ps, *pt;
5087
   int one(), i, j, k;
5088
   static int x[] = {1,3,5};
5089
   static int *pint = x+2;
5090
   static int zero[10];
5091
   int *apint = pint-1;
5092
   register int *rpint = apint+one();
5093
   static float y0[] = {1,3,5,2,4,6,3,5,7,0,0,0};
5094
   static float y1[4][3] = {
5095
     {1,3,5},
5096
     {2,4,6},
5097
     {3,5,7},
5098
   };
5099
   static float y2[4][3] = {1,3,5,2,4,6,3,5,7};
5100
   static float y3[4][3] = {
5101
     {1},{2},{3},{4}
5102
   };
5103
   ps = qs86;
5104
   pt = pd0->rfs;
5105
   rc = 0;
5106
   while (*pt++ = *ps++);
5107
 
5108
        /* The expression in an initializer for a static or
5109
        external variable must be a constant expression or
5110
        an expression that reduces to the address of a pre-
5111
        viously declared variable, possibly offset by a
5112
        constant expression.
5113
                                                                */
5114
 
5115
   if(*pint != 5){
5116
     if(pd0->flgd != 0) printf(s86er,1);
5117
     rc = rc+1;
5118
   }
5119
 
5120
        /* Automatic and register variables may be initialized
5121
        by arbitrary expressions involving constants and previously
5122
        declared variables and functions.
5123
                                                                */
5124
 
5125
   if(*apint != 3){
5126
     if(pd0->flgd != 0) printf(s86er,2);
5127
     rc = rc+2;
5128
   }
5129
 
5130
   if(*rpint != 5){
5131
     if(pd0->flgd != 0) printf(s86er,4);
5132
     rc = rc+4;
5133
   }
5134
 
5135
        /* Static variables that are not initialized are guar-
5136
        anteed to start off as zero.
5137
                                                        */
5138
 
5139
   lrc = 0;
5140
   for(j=0; j<10; j++)
5141
     if(zero[j] != 0) lrc = 1;
5142
   if(lrc != 0){
5143
     if(pd0->flgd != 0) printf(s86er,8);
5144
     rc = rc+8;
5145
   }
5146
 
5147
        /* y0, y1, and y2, as declared, should define and
5148
        initialize identical arrays.
5149
                                                                */
5150
   lrc = 0;
5151
   for(i=0; i<4; i++)
5152
     for(j=0; j<3; j++){
5153
       k = 3*i+j;
5154
       if( y1[i][j] != y2[i][j]
5155
         ||y1[i][j] != y0[k]) lrc = 1;
5156
     }
5157
 
5158
   if(lrc != 0){
5159
     if(pd0->flgd != 0) printf(s86er,16);
5160
     rc = rc+16;
5161
   }
5162
 
5163
        /* y3 initializes the first column of the array and
5164
        leaves the rest zero.
5165
                                                                */
5166
 
5167
   lrc = 0;
5168
   for(j=0; j<4; j++) if(y3[j][0] != j+1) lrc = 1;
5169
 
5170
   if(lrc != 0){
5171
     if(pd0->flgd != 0) printf(s86er,32);
5172
     rc = rc+32;
5173
   }
5174
   return rc;
5175
}
5176
one(){
5177
   return 1;
5178
}
5179
int *metricp;
5180
s88(pd0)          /*  8.8 Typedef  */
5181
struct defs *pd0;
5182
{
5183
   static char s88er[] = "s88,er%d\n";
5184
   static char qs88[8] = "s88    ";
5185
   int rc;
5186
   char *ps, *pt;
5187
 
5188
        /* Declarations whose "storage class" is typdef do not
5189
        define storage, but instead define identifiers which
5190
        can later be used as if they were type keywords naming
5191
        fundamental or derived types.
5192
                                                                */
5193
 
5194
   typedef int MILES, *KLICKSP;
5195
   typedef struct {double re, im;} complex;
5196
 
5197
   MILES distance;
5198
   extern KLICKSP metricp;
5199
   complex z, *zp;
5200
 
5201
   ps = qs88;
5202
   pt = pd0->rfs;
5203
   rc = 0;
5204
   while(*pt++ = *ps++);
5205
 
5206
        /* Hopefully, all of this stuff will compile. After that,
5207
        we can only make some superficial tests.
5208
 
5209
        The type of distance is int,
5210
                                                                */
5211
 
5212
   if(sizeof distance != sizeof(int)){
5213
     if(pd0->flgd != 0) printf(s88er,1);
5214
     rc = rc+1;
5215
   }
5216
 
5217
        /* that of metricp is "pointer to int",                 */
5218
 
5219
   metricp = &distance;
5220
   distance = 2;
5221
   *metricp = 3;
5222
 
5223
   if(distance != 3){
5224
     if(pd0->flgd != 0) printf(s88er,2);
5225
     rc = rc+2;
5226
   }
5227
 
5228
        /* and that of z is the specified structure. zp is a
5229
        pointer to such a structure.
5230
                                                                */
5231
 
5232
   z.re = 0.;
5233
   z.im = 0.;
5234
   zp = &z;
5235
   zp->re = 1.;
5236
   zp->im = 1.;
5237
   if(z.re+z.im != 2.){
5238
     if(pd0->flgd != 0) printf(s88er,4);
5239
     rc = rc+4;
5240
   }
5241
 
5242
   return rc;
5243
}
5244
s9(pd0)          /*  9  Statements  */
5245
struct defs *pd0;
5246
{
5247
   static char s9er[] = "s9,er%d\n";
5248
   static char qs9[8] = "s9     ";
5249
   int rc;
5250
   char *ps, *pt;
5251
   int lrc, i;
5252
 
5253
   ps = qs9;
5254
   pt = pd0->rfs;
5255
   rc = 0;
5256
   while (*pt++ = *ps++);
5257
 
5258
        /* One would think that the section on statements would
5259
        provide the most variety in the entire sequence of tests.
5260
        As it turns out, most of the material in this section has
5261
        already been checked in the process of checking out
5262
        everything else, and the section at this point is somewhat
5263
        anticlimactic. For this reason, we restrict ourselves
5264
        to testing two features not already covered.
5265
 
5266
        Compound statements are delimited by braces. They have the
5267
        nice property that identifiers of the auto and register
5268
        variety are pushed and popped. It is currently legal to
5269
        transfer into a block, but we wont...
5270
                                                                */
5271
 
5272
   lrc = 0;
5273
   for(i=0; i<2; i++){
5274
     int j;
5275
     register int k;
5276
     j = k = 2;
5277
       {
5278
       int j;
5279
       register int k;
5280
       j = k = 3;
5281
       if((j != 3) || (k != 3)) lrc = 1;
5282
       }
5283
     if((j != 2) || (k != 2)) lrc = 1;
5284
   }
5285
 
5286
   if(lrc != 0){
5287
     if(pd0->flgd != 0) printf(s9er,1);
5288
     rc = rc+1;
5289
   }
5290
 
5291
        /* Goto statements go to labeled statements, we hope.   */
5292
 
5293
   goto nobarf;
5294
     if(pd0->flgd != 0) printf(s9er,2);
5295
     rc = rc+2;
5296
   nobarf:;
5297
 
5298
   return rc;
5299
}
5300
setev(){                  /* Sets an external variable. Used  */
5301
   extern int extvar;     /* by s4, and should be compiled    */
5302
   extvar = 1066;         /* separately from s4.              */
5303
}
5304
     int lbits;          /*                 long           */
5305
     int ubits;          /*                 unsigned       */
5306
     int fbits;          /*                 float          */
5307
     int dbits;          /*                 double         */
5308
     float fprec;        /* Smallest number that can be    */
5309
     float dprec;        /* significantly added to 1.      */
5310
     int flgs;           /* Print return codes, by section */
5311
     int flgm;           /* Announce machine dependencies  */
5312
     int flgd;           /* give explicit diagnostics      */
5313
     int flgl;           /* Report local return codes.     */
5314
     int rrc;            /* recent return code             */
5315
     int crc;            /* Cumulative return code         */
5316
     char rfs[8];        /* Return from section            */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.