2 ****************************************************************************
4 * "DHRYSTONE" Benchmark Program
5 * -----------------------------
7 * Version: C, Version 2.1
9 * File: dhry_2.c (part 3 of 3)
13 * Author: Reinhold P. Weicker
15 ****************************************************************************
22 /* REG becomes defined as empty */
23 /* i.e. no register variables */
27 extern char Ch_1_Glob
;
30 void Proc_6 (Enumeration Enum_Val_Par
, Enumeration
*Enum_Ref_Par
)
31 /*********************************/
33 /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
35 *Enum_Ref_Par
= Enum_Val_Par
;
36 if (! Func_3 (Enum_Val_Par
))
37 /* then, not executed */
38 *Enum_Ref_Par
= Ident_4
;
42 *Enum_Ref_Par
= Ident_1
;
47 *Enum_Ref_Par
= Ident_1
;
48 else *Enum_Ref_Par
= Ident_4
;
50 case Ident_3
: /* executed */
51 *Enum_Ref_Par
= Ident_2
;
55 *Enum_Ref_Par
= Ident_3
;
61 void Proc_7 (One_Fifty Int_1_Par_Val
, One_Fifty Int_2_Par_Val
, One_Fifty
*Int_Par_Ref
)
62 /**********************************************/
63 /* executed three times */
64 /* first call: Int_1_Par_Val == 2, Int_2_Par_Val == 3, */
65 /* Int_Par_Ref becomes 7 */
66 /* second call: Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
67 /* Int_Par_Ref becomes 17 */
68 /* third call: Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
69 /* Int_Par_Ref becomes 18 */
73 Int_Loc
= Int_1_Par_Val
+ 2;
74 *Int_Par_Ref
= Int_2_Par_Val
+ Int_Loc
;
78 void Proc_8 (Arr_1_Dim Arr_1_Par_Ref
, Arr_2_Dim Arr_2_Par_Ref
, int Int_1_Par_Val
, int Int_2_Par_Val
)
79 /*********************************************************************/
81 /* Int_Par_Val_1 == 3 */
82 /* Int_Par_Val_2 == 7 */
84 REG One_Fifty Int_Index
;
85 REG One_Fifty Int_Loc
;
87 Int_Loc
= Int_1_Par_Val
+ 5;
88 Arr_1_Par_Ref
[Int_Loc
] = Int_2_Par_Val
;
89 Arr_1_Par_Ref
[Int_Loc
+1] = Arr_1_Par_Ref
[Int_Loc
];
90 Arr_1_Par_Ref
[Int_Loc
+30] = Int_Loc
;
91 for (Int_Index
= Int_Loc
; Int_Index
<= Int_Loc
+1; ++Int_Index
)
92 Arr_2_Par_Ref
[Int_Loc
] [Int_Index
] = Int_Loc
;
93 Arr_2_Par_Ref
[Int_Loc
] [Int_Loc
-1] += 1;
94 Arr_2_Par_Ref
[Int_Loc
+20] [Int_Loc
] = Arr_1_Par_Ref
[Int_Loc
];
99 Enumeration
Func_1 (Capital_Letter Ch_1_Par_Val
, Capital_Letter Ch_2_Par_Val
)
100 /*************************************************/
101 /* executed three times */
102 /* first call: Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R' */
103 /* second call: Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C' */
104 /* third call: Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C' */
107 Capital_Letter Ch_1_Loc
;
108 Capital_Letter Ch_2_Loc
;
110 Ch_1_Loc
= Ch_1_Par_Val
;
112 if (Ch_2_Loc
!= Ch_2_Par_Val
)
115 else /* not executed */
117 Ch_1_Glob
= Ch_1_Loc
;
123 Boolean
Func_2 (Str_30 Str_1_Par_Ref
, Str_30 Str_2_Par_Ref
)
124 /*************************************************/
126 /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
127 /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
130 REG One_Thirty Int_Loc
;
131 Capital_Letter Ch_Loc
;
134 while (Int_Loc
<= 2) /* loop body executed once */
135 if (Func_1 (Str_1_Par_Ref
[Int_Loc
],
136 Str_2_Par_Ref
[Int_Loc
+1]) == Ident_1
)
142 if (Ch_Loc
>= 'W' && Ch_Loc
< 'Z')
143 /* then, not executed */
146 /* then, not executed */
150 if (strcmp (Str_1_Par_Ref
, Str_2_Par_Ref
) > 0)
151 /* then, not executed */
163 Boolean
Func_3 (Enumeration Enum_Par_Val
)
164 /***************************/
166 /* Enum_Par_Val == Ident_3 */
168 Enumeration Enum_Loc
;
170 Enum_Loc
= Enum_Par_Val
;
171 if (Enum_Loc
== Ident_3
)
174 else /* not executed */