Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
7a550e8c
Commit
7a550e8c
authored
Aug 22, 2007
by
Matthias Braun
Browse files
am_test2
[r15581]
parent
daadfb78
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/test/am_test2.c
0 → 100644
View file @
7a550e8c
#include
<stdio.h>
int
arr
[
10
]
=
{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
};
int
sum
(
int
from
,
int
to
)
{
int
i
,
res
=
0
;
int
len
=
to
-
from
;
for
(
i
=
0
;
i
<
len
;
++
i
)
{
res
+=
arr
[
from
+
i
];
}
return
res
;
}
int
main
(
int
argc
,
char
**
argv
)
{
int
from
=
0
;
int
to
=
10
;
if
(
argc
>
1
)
to
=
atoi
(
argv
[
1
]);
printf
(
"Sum: %d
\n
"
,
sum
(
from
,
to
));
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment