summaryrefslogtreecommitdiffstats
path: root/package/dhrystone/dhrystone-2-cmdline-nruns.patch
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-12-07 16:07:27 -0500
committerPeter Korsgaard <jacmet@sunsite.dk>2010-12-08 23:37:48 +0100
commit9ffc2e809c9a1a6be135d6ec5503e8d0717d2cc0 (patch)
tree0de2cb1967ac3bd8610389904588c1a001352596 /package/dhrystone/dhrystone-2-cmdline-nruns.patch
parentbeb56ca618da3c2bcffb806c6d7fae725e56162e (diff)
downloadbuildroot-novena-9ffc2e809c9a1a6be135d6ec5503e8d0717d2cc0.tar.gz
buildroot-novena-9ffc2e809c9a1a6be135d6ec5503e8d0717d2cc0.zip
dhrystone: new benchmark package
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/dhrystone/dhrystone-2-cmdline-nruns.patch')
-rw-r--r--package/dhrystone/dhrystone-2-cmdline-nruns.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/package/dhrystone/dhrystone-2-cmdline-nruns.patch b/package/dhrystone/dhrystone-2-cmdline-nruns.patch
new file mode 100644
index 000000000..1164610cc
--- /dev/null
+++ b/package/dhrystone/dhrystone-2-cmdline-nruns.patch
@@ -0,0 +1,53 @@
+let people specify the number of runs on the command line
+
+Patch by Vivi Li <vivi.li@analog.com>
+
+--- a/dhry_1.c
++++ b/dhry_1.c
+@@ -66,7 +70,7 @@
+ /* end of variables for time measurement */
+
+
+-main ()
++main(int argc, char *argv[])
+ /*****/
+
+ /* main program, corresponds to procedures */
+@@ -101,6 +105,13 @@
+ /* Warning: With 16-Bit processors and Number_Of_Runs > 32000, */
+ /* overflow may occur for this array element. */
+
++ Number_Of_Runs = 0;
++ if ( argc == 2 ) {
++ if (atoi(argv[1]) > 0) {
++ Number_Of_Runs = atoi(argv[1]);
++ }
++ }
++
+ printf ("\n");
+ printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
+ printf ("\n");
+@@ -114,13 +125,17 @@
+ printf ("Program compiled without 'register' attribute\n");
+ printf ("\n");
+ }
+- printf ("Please give the number of runs through the benchmark: ");
+- {
+- int n;
+- scanf ("%d", &n);
+- Number_Of_Runs = n;
++
++ if (!Number_Of_Runs) {
++ printf ("Please give the number of runs through the benchmark: ");
++ fflush (stdout);
++ {
++ int n;
++ scanf ("%d", &n);
++ Number_Of_Runs = n;
++ }
++ printf ("\n");
+ }
+- printf ("\n");
+
+ printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
+