aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.hp/sum.c')
-rw-r--r--gdb/testsuite/gdb.hp/sum.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.hp/sum.c b/gdb/testsuite/gdb.hp/sum.c
new file mode 100644
index 00000000000..c28afa53856
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/sum.c
@@ -0,0 +1,15 @@
+/* This is a sample program for the HP/DDE debugger. */
+#include <stdio.h>
+
+#ifdef __STDC__
+int sum(int list[], int low, int high)
+#else
+int sum(list, low, high)
+int list[], low, high;
+#endif
+ {
+ int i, s = 0;
+ for (i = low; i <= high; i++)
+ s += list[i];
+ return(s);
+ }