summary refs log tree commit diff
path: root/test/mem1.ssa
blob: b7045a62d94a3026f44302ecbc1400d91eff9bad (plain) (blame)
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
type :i3 = { w 3 } 

export
function :i3 $blit() {
@start
	%l0 =l alloc4 12
	%l1 =l alloc4 12

	storew 287454020, %l0
	%l04 =l add %l0, 4
	storew 1432778632, %l04
	%l08 =l add %l0, 8
	storew 2578103244, %l08

	# we expect that %l0 and %l1
	# are coalesced and the blit
	# goes backwards
	%l11 =l add %l1, 1
	blit %l0, %l11, 11

	storeb 221, %l1

	ret %l1
}

# >>> driver
# struct i3 { int a, b, c; };
# extern struct i3 blit();
# int main() {
# 	struct i3 s = blit();
# 	return !(s.a == 0x223344dd
# 	      && s.b == 0x66778811
# 	      && s.c == 0xaabbcc55);
# }
# <<<