repo.or.cz
/
qbe.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
relax one assert
[qbe.git]
/
test
/
loop.ssa
blob
98914d914a25bc3e562850834fc7b82a7a9614d5
1
# simple looping program
2
# sums all integers from 100 to 0
3
4
export
5
function $test() {
6
@start
7
8
@loop
9
%s =w phi @start 0, @loop %s1
10
%n =w phi @start 100, @loop %n1
11
%s1 =w add %s, %n
12
%n1 =w sub %n, 1
13
jnz %n1, @loop, @end
14
15
@end
16
storew %s1, $a
17
ret
18
}
19
20
# >>> driver
21
# extern void test(void);
22
# int a;
23
# int main() { test(); return !(a == 5050); }
24
# <<<