aboutsummaryrefslogtreecommitdiff
path: root/test/do-loop.qbe
blob: 2f0e12a336e2a4133c5d04c758ccf1984d7ffcb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export
function w $main() {
@start.1
	%.1 =l alloc4 4
	%.2 =l alloc4 4
@body.2
	storew 2, %.1
	storew 0, %.2
@do_body.3
	%.3 =w loadsw %.1
	%.4 =w ceqw %.3, 1
	%.5 =w cnew %.4, 0
	jnz %.5, @if_true.6, @if_false.7
@if_true.6
	jmp @do_cond.4
@if_false.7
	%.6 =w loadsw %.2
	%.7 =w add %.6, 1
	storew %.7, %.2
@do_cond.4
	%.8 =w loadsw %.1
	%.9 =w sub %.8, 1
	storew %.9, %.1
	%.10 =w cnew %.8, 0
	jnz %.10, @do_body.3, @do_join.5
@do_join.5
	%.11 =w loadsw %.2
	%.12 =w cnew %.11, 2
	ret %.12
}