. "$BST_LIB" require dhry dhrystone/present # dhrystone 2.1 (Weicker, 1988) — the integer CPU benchmark, /usr/bin/dhry. # # WHAT THIS SUITE IS ACTUALLY FOR. Dhrystone's famous output is a score, but its # useful output on a NEW ARM is the block above the score: twenty-odd variables # whose final values the program publishes as "should be" alongside what it # actually got. Each one is the residue of a specific language feature the # benchmark exercises -- whole-struct assignment through a union with a # discriminant, a self-referential record chased two links deep, 1-D and 2-D # array indexing, an enum switch, char compare, call-by-reference, strcpy and # strcmp -- so a single wrong value is a codegen fault on this arm, named. That # makes dhrystone a correctness oracle wearing a benchmark's clothes, and it is # why almost every case below asserts an invariant rather than a rate. # # THE COUNT COMES FROM STDIN, NOT argv. dhry printf's a prompt and scanf's the # iteration count, and it does NOT check the scanf: `dhry "$work/big" 2>&1; rc=$? if [ "$rc" -eq 0 ]; then bst_ok dhrystone/exit-0 else bst_notok dhrystone/exit-0 "rc=$rc $(_bst_1line "$(cat "$work/big")")"; fi check_out dhrystone/banner "Dhrystone Benchmark, Version 2.1 (Language: C)" cat "$work/big" check_out dhrystone/stdin-count "Execution starts, $N runs through Dhrystone" cat "$work/big" check_out dhrystone/completes "Execution ends" cat "$work/big" # Five field names (Ptr_Comp, Discr, Enum_Comp, Int_Comp, Str_Comp) are printed # once for Ptr_Glob and again for Next_Ptr_Glob, so split the report at the # second record before reading any of them by name. sed -n '1,/^Next_Ptr_Glob->/p' "$work/big" > "$work/a" sed -n '/^Next_Ptr_Glob->/,$p' "$work/big" > "$work/b" # fld