repo.or.cz
/
smatch.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
missing_break: turn it off by default
[smatch.git]
/
validation
/
backend
/
sum.c
blob
06042999f413fa4268ac8ac7d7ff2734d99dcd9a
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
static int
sum
(
int
n
)
5
{
6
int
i
,
result
=
0
;
7
8
for
(
i
=
1
;
i
<=
n
; ++
i
)
9
result
+=
i
;
10
return
result
;
11
}
12
13
int
main
(
int
argc
,
char
**
argv
)
14
{
15
printf
(
"%d
\n
"
,
sum
(
5
));
16
printf
(
"%d
\n
"
,
sum
(
100
));
17
return
0
;
18
}
19
20
/*
21
* check-name: sum from 1 to n
22
* check-command: sparsei $file
23
*
24
* check-output-start
25
15
26
5050
27
* check-output-end
28
*/