summary refs log tree commit diff
path: root/test/fold1.ssa
blob: 9fb5d71a657f4c271b35063674589d37ca017d14 (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
export
function w $f1() {
@start
	%x =w sar 2147483648, 31
	ret %x
}

export
function w $f2() {
@start
	%x =w div 4294967040, 8  # -256 / 8
	ret %x
}

export
function w $f3() {
@start
	%x =w rem 4294967284, 7  # -12 % 7
	ret %x
}

export
function w $f4() {
@start
	%x =w shr 4294967296, 1  # 2^32 >> 1
	ret %x
}

export
function w $f5() {
@start
	%x =w udiv 1, 4294967297  # 1 / (2^32 + 1)
	ret %x
}

export
function w $f6() {
@start
	%x =w urem 4294967296, 7  # 2^32 % 7
	ret %x
}

# >>> driver
# extern int f1(), f2(), f3(), f4(), f5(), f6();
# int main() { return !(f1() == -1 && f2() == -32 && f3() == -5 &&
#                       f4() == 0 && f5() == 1 && f6() == 0); }
# <<<