summary refs log tree commit diff
path: root/test/mem3.ssa
blob: a6cafd2ee5436075b91d208e6439bccb0df3df37 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
# Ember Sawady reported this bug
# in stack-slot coalescing

type :type.3 = align 8 { l 1, l 1 }
type :tags.2 = { { :type.3 1 } }
type :type.1 = align 8 { w 1, :tags.2 1 }
type :tags.9 = { { w 1 } }
type :type.8 = align 4 { w 1, :tags.9 1 }

function :type.1 $func() {
@start.0
	%object.5 =l alloc8 24
	%object.7 =l alloc4 8
	%binding.21 =l alloc8 16
	%object.23 =l alloc8 24
@body.4
	%.10 =l add %object.7, 4
	jnz 1, @matches.13, @next.14
@matches.13
	# binding.21 gets fused with object.23
	storel 1, %binding.21
	%value.22 =l add %binding.21, 8
	storel 2, %value.22
	%.24 =l add %object.23, 8
	# but the blit direction is not set correctly
	blit %binding.21, %.24, 16
	ret %object.23
@next.14
	storew 2543892678, %object.5
	ret %object.5
}

export function w $main() {
@start.27
	%object.43 =l alloc8 24
	%object.49 =l alloc8 24
@body.28
	%returns.34 =:type.1 call $func()
	%value.47 =l add %returns.34, 16
	%load.48 =l loadl %value.47
	%.33 =w ceql %load.48, 2
	jnz %.33, @passed.32, @failed.31
@failed.31
	call $abort()
@passed.32
	ret 0
}