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