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