nixify
This commit is contained in:
47
test/fold1.ssa
Normal file
47
test/fold1.ssa
Normal file
@@ -0,0 +1,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); }
|
||||
# <<<
|
||||
Reference in New Issue
Block a user