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