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