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
db/fixup_kernel.sh: update vfs_write() code
[smatch.git]
/
validation
/
backend
/
sum.c
blob
38ebf41ed16c731c7e0643d7a9d18cec856cfe6d
1
int
printf
(
const char
*
fmt
, ...);
2
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
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
*/