xref: /aosp_15_r20/external/swiftshader/third_party/subzero/crosstest/simple_loop.c (revision 03ce13f70fcc45d86ee91b7ee4cab1936a95046e)
1 // 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 
simple_loop(int * a,int n)5 int 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 }
11