summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.hp/gdb.compat/sum.c
blob: d295f7e27939cb977c12e0f20a9b655699d98027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 = 0, s = 0;
        for (i = low; i <= high; i++)
            s += list[i];
        return(s);
    }