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