blob: 6568380de318f72fba9cd721dee631ffe079e50c [file] [log] [blame]
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -07001// This is a simple loop that sums elements of an input array and
2// returns the result. It's here mainly because it's one of the
3// simple examples guiding the early Subzero design.
4
5int simple_loop(int *a, int n) {
6 int sum = 0;
7 for (int i = 0; i < n; ++i)
8 sum += a[i];
9 return sum;
10}