projects
/
libfirm
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Some more boolopt tests.
[libfirm]
/
ir
/
be
/
test
/
am_test2.c
1
#include <stdio.h>
2
3
int arr[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
4
5
int sum(int from, int to) {
6
int i, res = 0;
7
int len = to - from;
8
9
for(i = 0; i < len; ++i) {
10
res += arr[from + i];
11
}
12
13
return res;
14
}
15
16
int main(int argc, char **argv) {
17
int from = 0;
18
int to = 10;
19
if(argc > 1)
20
to = atoi(argv[1]);
21
22
printf("Sum: %d\n", sum(from, to));
23
return 0;
24
}