summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/sum.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-06-28 23:04:32 +0000
committerJason Molenda <jmolenda@apple.com>1999-06-28 23:04:32 +0000
commit74cf13956febb1f6c8e0f5d5f48814953d41dd28 (patch)
treef06240a34afca06791450a91c8aac297abda27df /gdb/testsuite/gdb.base/sum.c
parent9cd2c67bacb9aaa7e82457e68e1a6087c8bde928 (diff)
downloadbinutils-gdb-74cf13956febb1f6c8e0f5d5f48814953d41dd28.tar.gz
import gdb-1999-06-28 snapshot
Diffstat (limited to 'gdb/testsuite/gdb.base/sum.c')
-rw-r--r--gdb/testsuite/gdb.base/sum.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/sum.c b/gdb/testsuite/gdb.base/sum.c
new file mode 100644
index 00000000000..f5a5dbf2631
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sum.c
@@ -0,0 +1,15 @@
+/* This is a sample program for the HP/DDE debugger. */
+#include <stdio.h>
+
+#ifdef PROTOTYPES
+int sum(int *list, int low, int high)
+#else
+int sum(list, low, high)
+int *list, low, high;
+#endif
+ {
+ int i = 0, s = 0;
+ for (i = low; i <= high; i++)
+ s += list[i];
+ return(s);
+ }