aboutsummaryrefslogtreecommitdiff
path: root/test/varargs+riscv64.qbe
blob: 48638bb040a543d91a43d857068854f4754761f6 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
export
function w $f1(w %.1, l %.3) {
@start.1
	%.2 =l alloc4 4
	storew %.1, %.2
	%.4 =l alloc8 8
	storel %.3, %.4
@body.2
	%.5 =w vaarg %.4
	ret %.5
}
export
function w $f2(w %.1, ...) {
@start.3
	%.2 =l alloc4 4
	storew %.1, %.2
	%.3 =l alloc4 4
	%.4 =l alloc8 8
@body.4
	vastart %.4
	%.5 =w loadw %.2
	%.6 =l loadl %.4
	%.7 =w call $f1(w %.5, l %.6)
	storew %.7, %.3
	%.8 =l loadl %.4
	%.9 =w loadw %.3
	ret %.9
}
export
function $f3(w %.1, ...) {
@start.5
	%.2 =l alloc4 4
	storew %.1, %.2
	%.3 =l alloc8 8
@body.6
	vastart %.3
@while_cond.7
	%.4 =w loadw %.2
	jnz %.4, @while_body.8, @while_join.9
@while_body.8
	%.5 =w vaarg %.3
	%.6 =s vaarg %.3
	%.7 =l vaarg %.3
	%.8 =w loadw %.2
	%.9 =w sub %.8, 1
	storew %.9, %.2
	jmp @while_cond.7
@while_join.9
	%.10 =l loadl %.3
	ret
}