aboutsummaryrefslogtreecommitdiff
path: root/test/do-loop.qbe
blob: c6c5081a2d81767a77dac858111e9e9734740659 (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
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 loadw %.1
	%.4 =w ceqw %.3, 1
	jnz %.4, @if_true.6, @if_false.7
@if_true.6
	jmp @do_cond.4
@if_false.7
	%.5 =w loadw %.2
	%.6 =w add %.5, 1
	storew %.6, %.2
@do_cond.4
	%.7 =w loadw %.1
	%.8 =w sub %.7, 1
	storew %.8, %.1
	jnz %.7, @do_body.3, @do_join.5
@do_join.5
	%.9 =w loadw %.2
	%.10 =w cnew %.9, 2
	ret %.10
}