projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more libc mapper functions added
[libfirm]
/
ir
/
be
/
test
/
am_test2.c
diff --git
a/ir/be/test/am_test2.c
b/ir/be/test/am_test2.c
index
2e628a7
..
88b9108
100644
(file)
--- a/
ir/be/test/am_test2.c
+++ b/
ir/be/test/am_test2.c
@@
-3,14
+3,15
@@
int arr[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int sum(int from, int to) {
int arr[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int sum(int from, int to) {
- int i, res = 0;
+ int i, res = 0
, res2 = 666
;
int len = to - from;
for(i = 0; i < len; ++i) {
int len = to - from;
for(i = 0; i < len; ++i) {
- res += arr[from + i];
+ res += arr[from + i];
+ res2 -= arr[i];
}
}
- return res;
+ return res
^ res2
;
}
int main(int argc, char **argv) {
}
int main(int argc, char **argv) {
@@
-19,6
+20,6
@@
int main(int argc, char **argv) {
if(argc > 1)
to = atoi(argv[1]);
if(argc > 1)
to = atoi(argv[1]);
- printf("
Sum
: %d\n", sum(from, to));
+ printf("
Res
: %d\n", sum(from, to));
return 0;
}
return 0;
}