• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 int printf(const char * fmt, ...);
2 
sum(int n)3 static int sum(int n)
4 {
5 	int i, result = 0;
6 
7 	for (i = 1; i <= n; ++i)
8 		result += i;
9 	return result;
10 }
11 
main(int argc,char ** argv)12 int main(int argc, char **argv)
13 {
14 	printf("%d\n", sum(5));
15 	printf("%d\n", sum(100));
16 	return 0;
17 }
18 
19 /*
20  * check-name: sum from 1 to n
21  * check-command: sparsei --no-jit $file
22  *
23  * check-output-start
24 15
25 5050
26  * check-output-end
27  */
28