aboutsummaryrefslogtreecommitdiff
path: root/test/do-loop.qbe
blob: d31c80c0111ebf78efef20b045ad1c33aa49dd7f (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
31
32
export
function w $main() {
@start.1
	%.1 =l alloc4 4
	%.3 =l alloc4 4
@body.2
	%.2 =l add %.1, 0
	storew 2, %.2
	%.4 =l add %.3, 0
	storew 0, %.4
@do_body.3
	%.5 =w loadsw %.1
	%.6 =w ceqw %.5, 1
	%.7 =w cnew %.6, 0
	jnz %.7, @if_true.6, @if_false.7
@if_true.6
	jmp @do_cond.4
@if_false.7
	%.8 =w loadsw %.3
	%.9 =w add %.8, 1
	storew %.9, %.3
@do_cond.4
	%.10 =w loadsw %.1
	%.11 =w sub %.10, 1
	storew %.11, %.1
	%.12 =w cnew %.10, 0
	jnz %.12, @do_body.3, @do_join.5
@do_join.5
	%.13 =w loadsw %.3
	%.14 =w cnew %.13, 2
	ret %.14
}