aboutsummaryrefslogtreecommitdiff
path: root/test/varargs+x86_64-sysv.qbe
blob: 4fa8e7b9ea2cec6c415fa06c81c65e3fc0641b21 (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
52
53
54
55
56
57
58
59
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 =l loadl %.4
	%.6 =w vaarg %.5
	ret %.6
}
export
function w $f2(w %.1, ...) {
@start.3
	%.2 =l alloc4 4
	storew %.1, %.2
	%.3 =l alloc4 4
	%.4 =l alloc8 24
@body.4
	vastart %.4
	%.5 =w loadw %.2
	%.6 =w call $f1(w %.5, l %.4)
	storew %.6, %.3
	%.7 =w loadw %.3
	ret %.7
}
export
function $f3(w %.1, ...) {
@start.5
	%.2 =l alloc4 4
	storew %.1, %.2
	%.3 =l alloc8 24
@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
	ret
}
export
function $f4(...) {
@start.10
	%.1 =l alloc8 24
@body.11
	vastart %.1
	%.2 =d vaarg %.1
	%.3 =w vaarg %.1
	ret
}