update for tinibios
[fw/sdcc] / support / tests / dhrystone / dhry.c
1 /** Sanatised version of the dhrystone-2.1 test.
2
3     Modifications Michael Hope <michaelh@earthling.net>
4
5     This is derrived from the dhrystone-2.1.tar.gz tarball available
6     all over the net.  I sourced it from the Red Hat src rpm.
7
8     Modifications:
9     * Made it more ANSI compliant.
10     * Changed any array function arguments to pointers to make my 
11       compiler work.
12     * Removed malloc's for a couple of static arrays.
13     * Into one file.
14     * Proc_8 is a bit messy.  It originally took a 2 dim array, but
15       sdcc doesnt support this.  So the offsets are hard coded...
16
17     Notes:
18     * The comment at the start of Func_1 about the input being
19       H, R on the first call is wrong - Func_1 is first called
20       from Func_2 where the input is R, Y.  The test still succeeds.
21
22     References:
23     * http://www.netlib.org/performance/html/dhry.intro.html
24     * http://www.netlib.org/performance/html/dhry.data.col0.html
25
26     I couldnt find a copyright in the original - the most relevent
27     part follows:
28
29     A SPECIAL THANKS
30     I didn't write the DHRYSTONE benchmark.  Rheinhold Weicker did. He has
31     certainly provided us with a useful tool for benchmarking, and is
32     to be congratulated.
33
34     Rick Richardson
35     PC Research, Inc.
36     (201) 389-8963 (9-17 EST)
37     (201) 542-3734 (7-9,17-24 EST)
38     ...!uunet!pcrat!rick        (normal mail)
39     ...!uunet!pcrat!dry2        (results only)
40 */
41
42 #define NOENUM          1
43 #define NOSTRUCTASSIGN  1
44 #define REG
45
46 #include "dhry.h"
47 #include <string.h>
48 /** For printf */
49 #include <stdio.h>
50
51 #ifdef SDCC_ds390
52 #include <tinibios.h>
53 #define clock() ClockTicks()
54 #define CLOCKS_PER_SEC 1000
55 #undef PRINT_T_STATES
56 #else
57 /** For clock() */
58 #include <time.h>
59 #include <types.h>
60 #define PRINT_T_STATES
61 #endif
62
63 /** Print the number of t-states this program has been executing for.
64     Optional :)
65 */
66 #ifdef PRINT_T_STATES
67 void _printTStates(void);
68 #endif
69
70 /** Set to one to print more messages about expected values etc. 
71  */
72 #define DEBUG   0
73
74 #if DEBUG
75 #define DPRINTF(_a) printf _a
76 #else
77 #define DPRINTF(_a)
78 #endif
79
80 Rec_Pointer     Ptr_Glob,
81                 Next_Ptr_Glob;
82 int             Int_Glob;
83 Boolean         Bool_Glob;
84 char            Ch_1_Glob,
85                 Ch_2_Glob;
86 int             Arr_1_Glob [50];
87 int             Arr_2_Glob [50] [50];
88
89 /* Used instead of malloc() */
90 static Rec_Type _r[2];
91
92 void Proc_1 (REG Rec_Pointer Ptr_Val_Par);
93 void Proc_2 (One_Fifty *Int_Par_Ref);
94 void Proc_5 (void);
95 void Proc_4 (void);
96 void Proc_7 (One_Fifty Int_1_Par_Val, One_Fifty Int_2_Par_Val, One_Fifty *Int_Par_Ref);
97 void Proc_8 (int *Arr_1_Par_Ref, int *Arr_2_Par_Ref,
98              int Int_1_Par_Val, int Int_2_Par_Val);
99 void Proc_6 (Enumeration Enum_Val_Par, Enumeration *Enum_Ref_Par);
100 void Proc_3 (Rec_Pointer *Ptr_Ref_Par);
101 Enumeration Func_1 (Capital_Letter Ch_1_Par_Val, Capital_Letter Ch_2_Par_Val);
102 Boolean Func_2 (char *Str_1_Par_Ref, char *Str_2_Par_Ref);
103 Boolean Func_3 (Enumeration Enum_Par_Val);
104
105 unsigned getsp(void);
106
107 int main(void)
108 {
109     One_Fifty       Int_1_Loc;
110     REG   One_Fifty       Int_2_Loc;
111     One_Fifty       Int_3_Loc;
112     REG   Capital_Letter Ch_Index;
113     Enumeration     Enum_Loc;
114     Str_30          Str_1_Loc;
115     Str_30          Str_2_Loc;
116     REG   int             Run_Index;
117     REG   int             Number_Of_Runs;
118     unsigned  long runTime;
119
120     printf("[dhry]\n");
121
122     Next_Ptr_Glob = &_r[0];
123     Ptr_Glob = &_r[1];
124
125     Ptr_Glob->Ptr_Comp                    = Next_Ptr_Glob;
126     Ptr_Glob->Discr                       = Ident_1;
127     Ptr_Glob->variant.var_1.Enum_Comp     = Ident_3;
128     Ptr_Glob->variant.var_1.Int_Comp      = 40;
129
130     strcpy(Ptr_Glob->variant.var_1.Str_Comp, 
131             "DHRYSTONE PROGRAM, SOME STRING");
132     strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
133
134     Arr_2_Glob [8][7] = 10;
135
136     /* Was missing in published program. Without this statement,    */
137     /* Arr_2_Glob [8][7] would have an undefined value.             */
138     /* Warning: With 16-Bit processors and Number_Of_Runs > 32000,  */
139     /* overflow may occur for this array element.                   */
140
141     /* 32766 is the highest value for a 16 bitter */
142 #if DEBUG
143     Number_Of_Runs = 3;
144 #else
145     Number_Of_Runs = 10000;
146 #endif    
147
148     runTime = clock();
149
150     /* Main test loop */
151     for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index) {
152         DPRINTF(("Run_Index = %d\n", Run_Index));
153         if (!(Run_Index & 1023))
154             printf("Loops: %u\r\n", Run_Index);
155         Proc_5();
156         Proc_4();
157         /* Ch_1_Glob == 'A', Ch_2_Glob == 'B', Bool_Glob == true */
158         DPRINTF(("Ch_1_Glob '%c' == 'A', Ch_2_Glob '%c' == 'B', Bool_Glob %d == 1\n", Ch_1_Glob, Ch_2_Glob, Bool_Glob));
159
160         Int_1_Loc = 2;
161         Int_2_Loc = 3;
162         strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
163         Enum_Loc = Ident_2;
164         Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
165         /* Bool_Glob == 1 */
166         DPRINTF(("Bool_Glob %d == 1, Int_1_Loc %d == 2, Int_2_Loc %d == 3\n", Bool_Glob, Int_1_Loc, Int_2_Loc));
167         while (Int_1_Loc < Int_2_Loc)  /* loop body executed once */
168             {
169                 DPRINTF(("m.1 Executes once.\n"));
170                 Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
171                 /* Int_3_Loc == 7 */
172                 DPRINTF(("Int_3_Loc %d == 7\n", Int_3_Loc));
173                 DPRINTF(("Proc_7\n"));
174                 Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
175                 /* Int_3_Loc == 7 */
176                 Int_1_Loc += 1;
177             } /* while */
178         DPRINTF(("m.2 Check above executed once.\n"));
179         /* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
180         DPRINTF(("Int_1_Loc %d == 3, Int_2_Loc %d == 3, Int_3_Loc %d == 7\n",
181                Int_1_Loc, Int_2_Loc, Int_3_Loc));
182
183         DPRINTF(("Proc_8\n"));
184         Proc_8 (Arr_1_Glob, (int *)Arr_2_Glob, Int_1_Loc, Int_3_Loc);
185         /* Int_Glob == 5 */
186         DPRINTF(("Int_Glob %d == 5\n", Int_Glob));
187         DPRINTF(("Proc_1\n"));
188         Proc_1 (Ptr_Glob);
189         for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
190             /* loop body executed twice */
191             {
192                 DPRINTF(("Func_1\n"));
193                 if (Enum_Loc == Func_1 (Ch_Index, 'C'))
194                     /* then, not executed */
195                     {
196                         DPRINTF(("Proc_6\n"));
197                         Proc_6 (Ident_1, &Enum_Loc);
198                         strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
199                         Int_2_Loc = Run_Index;
200                         Int_Glob = Run_Index;
201                     }
202             }
203         /* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
204         DPRINTF(("Int_1_Loc %d == 3, Int_2_Loc %d == 3, Int_3_Loc %d == 7\n",
205                Int_1_Loc, Int_2_Loc, Int_3_Loc));
206
207         Int_2_Loc = Int_2_Loc * Int_1_Loc;
208         Int_1_Loc = Int_2_Loc / Int_3_Loc;
209         Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
210         /* Int_1_Loc == 1, Int_2_Loc == 13, Int_3_Loc == 7 */
211         DPRINTF(("Int_1_Loc %d == 1, Int_2_Loc %d == 13, Int_3_Loc %d == 7\n",
212                Int_1_Loc, Int_2_Loc, Int_3_Loc));
213         DPRINTF(("Proc_2\n"));
214         Proc_2 (&Int_1_Loc);
215         /* Int_1_Loc == 5 */
216         DPRINTF(("Int_1_Loc %d == 5\n", Int_1_Loc));
217         DPRINTF(("Looping.\n"));
218     } /* loop "for Run_Index" */
219
220 #ifdef PRINT_T_STATES    
221     _printTStates();
222 #endif    
223
224     printf("Run_Index = %d\n", Run_Index);
225
226     runTime = clock() - runTime;
227
228 #if 1
229     printf ("Execution ends\n");
230     printf ("\n");
231     printf ("Final values of the variables used in the benchmark:\n");
232     printf ("\n");
233     printf ("Int_Glob:            %d\n", Int_Glob);
234     printf ("        should be:   %d\n", (int)5);
235     printf ("Bool_Glob:           %d\n", Bool_Glob);
236     printf ("        should be:   %d\n", (int)1);
237     printf ("Ch_1_Glob:           %c\n", Ch_1_Glob);
238     printf ("        should be:   %c\n", 'A');
239     printf ("Ch_2_Glob:           %c\n", Ch_2_Glob);
240     printf ("        should be:   %c\n", 'B');
241     printf ("Arr_1_Glob[8]:       %d\n", Arr_1_Glob[8]);
242     printf ("        should be:   %d\n", (int)7);
243 #if 1
244     printf ("Arr_2_Glob[8][7]:    %d\n", Arr_2_Glob[8][7]);
245 #endif
246     printf ("        should be:   Number_Of_Runs + 10\n");
247     printf ("Ptr_Glob->\n");
248     printf ("  Ptr_Comp:          %d\n", (int) Ptr_Glob->Ptr_Comp);
249     printf ("        should be:   (implementation-dependent)\n");
250     printf ("  Discr:             %d\n", (int)Ptr_Glob->Discr);
251     printf ("        should be:   %d\n", (int)0);
252     printf ("  Enum_Comp:         %d\n", (int)Ptr_Glob->variant.var_1.Enum_Comp);
253     printf ("        should be:   %d\n", (int)2);
254     printf ("  Int_Comp:          %d\n", (int)Ptr_Glob->variant.var_1.Int_Comp);
255     printf ("        should be:   %d\n", (int)17);
256     printf ("  Str_Comp:          %s\n", (char *)Ptr_Glob->variant.var_1.Str_Comp);
257     printf ("        should be:   DHRYSTONE PROGRAM, SOME STRING\n");
258     printf ("Next_Ptr_Glob->\n");
259     printf ("  Ptr_Comp:          %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
260     printf ("        should be:   (implementation-dependent), same as above\n");
261     printf ("  Discr:             %d\n", Next_Ptr_Glob->Discr);
262     printf ("        should be:   %d\n", (int)0);
263     printf ("  Enum_Comp:         %d\n", Next_Ptr_Glob->variant.var_1.Enum_Comp);
264     printf ("        should be:   %d\n", (int)1);
265     printf ("  Int_Comp:          %d\n", Next_Ptr_Glob->variant.var_1.Int_Comp);
266     printf ("        should be:   %d\n", (int)18);
267     printf ("  Str_Comp:          %s\n",
268             Next_Ptr_Glob->variant.var_1.Str_Comp);
269     printf ("        should be:   DHRYSTONE PROGRAM, SOME STRING\n");
270     printf ("Int_1_Loc:           %d\n", Int_1_Loc);
271     printf ("        should be:   %d\n", (int)5);
272     printf ("Int_2_Loc:           %d\n", Int_2_Loc);
273     printf ("        should be:   %d\n", (int)13);
274     printf ("Int_3_Loc:           %d\n", Int_3_Loc);
275     printf ("        should be:   %d\n", (int)7);
276     printf ("Enum_Loc:            %d\n", Enum_Loc);
277     printf ("        should be:   %d\n", (int)1);
278     printf ("Str_1_Loc:           %s\n", (char _generic *)Str_1_Loc);
279     printf ("        should be:   DHRYSTONE PROGRAM, 1'ST STRING\n");
280     printf ("Str_2_Loc:           %s\n", (char _generic *)Str_2_Loc);
281     printf ("        should be:   DHRYSTONE PROGRAM, 2'ND STRING\n");
282     printf ("\n");
283 #endif
284     printf("Dhrystones/s = %lu\n", (unsigned long)Number_Of_Runs / (runTime/CLOCKS_PER_SEC));
285     printf("MIPS = d/s/1757 = (sigh, need floats...)\n");
286 #ifdef PRINT_T_STATES    
287     _printTStates();
288 #endif    
289     printf("Time: %lu ticks\n", runTime);
290 }
291
292 void Proc_1 (REG Rec_Pointer Ptr_Val_Par)
293 /* executed once */
294 {
295     REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;  
296     /* == Ptr_Glob_Next */
297     /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp,    */
298     /* corresponds to "rename" in Ada, "with" in Pascal           */
299   
300     structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob); 
301     Ptr_Val_Par->variant.var_1.Int_Comp = 5;
302     Next_Record->variant.var_1.Int_Comp 
303         = Ptr_Val_Par->variant.var_1.Int_Comp;
304     Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
305     Proc_3 (&Next_Record->Ptr_Comp);
306     /* Ptr_Val_Par->Ptr_Comp->Ptr_Comp 
307        == Ptr_Glob->Ptr_Comp */
308     if (Next_Record->Discr == Ident_1)
309         /* then, executed */
310         {
311             Next_Record->variant.var_1.Int_Comp = 6;
312             Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp, 
313                     &Next_Record->variant.var_1.Enum_Comp);
314             Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
315             Proc_7 (Next_Record->variant.var_1.Int_Comp, 10, 
316                     &Next_Record->variant.var_1.Int_Comp);
317         }
318     else /* not executed */
319         structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
320 } /* Proc_1 */
321
322
323 void Proc_2 (One_Fifty *Int_Par_Ref)
324     /******************/
325     /* executed once */
326     /* *Int_Par_Ref == 1, becomes 4 */
327 {
328     One_Fifty  Int_Loc;  
329     Enumeration   Enum_Loc;
330
331     DPRINTF(("-> Proc_2\n"));
332
333     Int_Loc = *Int_Par_Ref + 10;
334     do {
335         DPRINTF(("1"));
336         /* executed once */
337         if (Ch_1_Glob == 'A')
338             /* then, executed */
339             {
340                 DPRINTF(("2"));
341                 Int_Loc -= 1;
342                 *Int_Par_Ref = Int_Loc - Int_Glob;
343                 Enum_Loc = Ident_1;
344             } /* if */
345         DPRINTF(("3"));
346     } while (Enum_Loc != Ident_1); /* true */
347     DPRINTF(("Proc_2 done.\n"));
348 } /* Proc_2 */
349
350
351 void Proc_3 (Rec_Pointer *Ptr_Ref_Par)
352     /******************/
353     /* executed once */
354     /* Ptr_Ref_Par becomes Ptr_Glob */
355 {
356     if (Ptr_Glob != Null)
357         /* then, executed */
358         *Ptr_Ref_Par = Ptr_Glob->Ptr_Comp;
359     Proc_7 (10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
360 } /* Proc_3 */
361
362 void Proc_4 (void) /* without parameters */
363     /*******/
364     /* executed once */
365 {
366     Boolean Bool_Loc;
367
368     DPRINTF(("-> Proc_4\n"));
369     Bool_Loc = Ch_1_Glob == 'A';
370     Bool_Glob = Bool_Loc | Bool_Glob;
371     Ch_2_Glob = 'B';
372     DPRINTF(("Expect Ch_1_Glob '%c' == 'A'\n", (char)Ch_1_Glob));
373     DPRINTF(("       Ch_2_Glob '%c' == 'B'\n", (char)Ch_2_Glob));
374     DPRINTF(("       Bool_Loc %d == 1\n", (unsigned)Bool_Loc));
375     DPRINTF(("       Bool_Glob %d == 1\n", (unsigned)Bool_Glob));
376 } /* Proc_4 */
377
378
379 void Proc_5 () /* without parameters */
380     /*******/
381     /* executed once */
382 {
383     Ch_1_Glob = 'A';
384     Bool_Glob = false;
385 } /* Proc_5 */
386
387 void Proc_6 (Enumeration Enum_Val_Par, Enumeration *Enum_Ref_Par)
388     /*********************************/
389     /* executed once */
390     /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
391
392 {
393     *Enum_Ref_Par = Enum_Val_Par;
394     if (! Func_3 (Enum_Val_Par))
395         /* then, not executed */
396         *Enum_Ref_Par = Ident_4;
397     switch (Enum_Val_Par)
398         {
399         case Ident_1: 
400             *Enum_Ref_Par = Ident_1;
401             break;
402         case Ident_2: 
403             if (Int_Glob > 100)
404                 /* then */
405                 *Enum_Ref_Par = Ident_1;
406             else *Enum_Ref_Par = Ident_4;
407             break;
408         case Ident_3: /* executed */
409             *Enum_Ref_Par = Ident_2;
410             break;
411         case Ident_4: break;
412         case Ident_5: 
413             *Enum_Ref_Par = Ident_3;
414             break;
415         } /* switch */
416 } /* Proc_6 */
417
418
419 /*************************************************/
420 /* executed three times                                         */
421 /* first call:      Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R'    */
422 /* second call:     Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C'    */
423 /* third call:      Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C'    */
424 Enumeration Func_1 (Capital_Letter Ch_1_Par_Val, Capital_Letter Ch_2_Par_Val)
425 {
426     Capital_Letter        Ch_1_Loc;
427     Capital_Letter        Ch_2_Loc;
428
429     DPRINTF(("-> Func_1\n"));
430     DPRINTF(("  Inputs: Ch_1_Par_Val '%c' == { R, A, B }\n", (char)Ch_1_Par_Val));
431     DPRINTF(("          Ch_2_Par_Val '%c' == { Y, C, C }\n", (char)Ch_2_Par_Val));
432
433     Ch_1_Loc = Ch_1_Par_Val;
434     Ch_2_Loc = Ch_1_Loc;
435     if (Ch_2_Loc != Ch_2_Par_Val) {
436         /* then, executed */
437         return (Ident_1);
438     }
439     else  /* not executed */
440         {
441             Ch_1_Glob = Ch_1_Loc;
442             return (Ident_2);
443         }
444 } /* Func_1 */
445
446 Boolean Func_3 (Enumeration Enum_Par_Val)
447     /***************************/
448     /* executed once        */
449     /* Enum_Par_Val == Ident_3 */
450 {
451     Enumeration Enum_Loc;
452
453     Enum_Loc = Enum_Par_Val;
454     if (Enum_Loc == Ident_3)
455         /* then, executed */
456         return (true);
457     else /* not executed */
458         return (false);
459 } /* Func_3 */
460
461 void Proc_7 (One_Fifty Int_1_Par_Val, One_Fifty Int_2_Par_Val, One_Fifty *Int_Par_Ref)
462     /**********************************************/
463     /* executed three times                                      */ 
464     /* first call:      Int_1_Par_Val == 2, Int_2_Par_Val == 3,  */
465     /*                  Int_Par_Ref becomes 7                    */
466     /* second call:     Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
467     /*                  Int_Par_Ref becomes 17                   */
468     /* third call:      Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
469     /*                  Int_Par_Ref becomes 18                   */
470 {
471     One_Fifty Int_Loc;
472
473     Int_Loc = Int_1_Par_Val + 2;
474     *Int_Par_Ref = Int_2_Par_Val + Int_Loc;
475 } /* Proc_7 */
476
477 /*void Proc_8 (Arr_1_Dim Arr_1_Par_Ref, Arr_2_Dim Arr_2_Par_Ref, 
478   int Int_1_Par_Val, int Int_2_Par_Val)*/
479 void Proc_8 (int *Arr_1_Par_Ref, int *Arr_2_Par_Ref,
480              int Int_1_Par_Val, int Int_2_Par_Val)
481 {
482     REG One_Fifty Int_Index;
483     REG One_Fifty Int_Loc;
484
485     DPRINTF(("-> Proc_8\n"));
486     Int_Loc = Int_1_Par_Val + 5;
487     Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
488     DPRINTF(("Int_Loc %d == 8 Int_2_Par_Val %d == 7\n", Int_Loc, Int_2_Par_Val));
489
490     Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
491     Arr_1_Par_Ref [Int_Loc+30] = Int_Loc;
492     for (Int_Index = Int_Loc; Int_Index <= Int_Loc+1; ++Int_Index)
493         Arr_2_Par_Ref [Int_Loc*50 + Int_Index] = Int_Loc;
494     Arr_2_Par_Ref [Int_Loc * 50 + Int_Loc-1] += 1;
495     Arr_2_Par_Ref [(Int_Loc+20 *50) + Int_Loc] = Arr_1_Par_Ref [Int_Loc];
496     Int_Glob = 5;
497     DPRINTF(("Arr_1_Glob[8] %d == 7\n", Arr_1_Par_Ref[8]));
498 }
499
500 /*********************************************************************/
501 /* executed once      */
502 /* Int_Par_Val_1 == 3 */
503 /* Int_Par_Val_2 == 7 */
504 Boolean Func_2 (char *Str_1_Par_Ref, char *Str_2_Par_Ref)
505     /*************************************************/
506     /* executed once */
507     /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
508     /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
509 {
510     REG One_Thirty        Int_Loc;
511     Capital_Letter    Ch_Loc;
512
513     DPRINTF(("-> Func_2\n"));
514     DPRINTF(("  Inputs Str_1_Par_Ref \"%s\" = \"DHRYSTONE PROGRAM, 1'ST STRING\"\n", Str_1_Par_Ref));
515     DPRINTF(("         Str_2_Par_Ref \"%s\" = \"DHRYSTONE PROGRAM, 2'ND STRING\"\n", Str_2_Par_Ref));
516
517     Int_Loc = 2;
518
519     while (Int_Loc <= 2) {
520         if (Func_1 (Str_1_Par_Ref[Int_Loc],
521                     Str_2_Par_Ref[Int_Loc+1]) == Ident_1)
522             /* then, executed */
523             {
524                 DPRINTF(("  2.3 Then OK.\n"));
525                 Ch_Loc = 'A';
526                 Int_Loc += 1;
527             } /* if, while */
528         else {
529             DPRINTF(("  2.2 Error.\n"));
530         }
531     }
532     if (Ch_Loc >= 'W' && Ch_Loc < 'Z') {
533         /* then, not executed */
534         DPRINTF((" 2.4 Error\n"));
535         Int_Loc = 7;
536     }
537     if (Ch_Loc == 'R') {
538         /* then, not executed */
539         DPRINTF((" 2.5 Error\n"));
540         return (true);
541     }
542     else /* executed */
543         {
544             DPRINTF(("Str_1_Par_Ref = \"%s\", Str_2_Par_Ref = \"%s\"\n",
545                    Str_1_Par_Ref, Str_2_Par_Ref));
546             if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
547                 /* then, not executed */
548                 {
549                     DPRINTF((" 2.5 Error diff=%d\n", strcmp(Str_1_Par_Ref, Str_2_Par_Ref)));
550                     Int_Loc += 7;
551                     Int_Glob = Int_Loc;
552                     return (true);
553                 }
554             else {
555                 /* executed */
556                 DPRINTF((" 2.6 OK\n"));
557                 return (false);
558             }
559         } /* if Ch_Loc */
560 } /* Func_2 */
561