some additions to core and test for them
This commit is contained in:
19
tests/core_bitops.expected
Normal file
19
tests/core_bitops.expected
Normal file
@@ -0,0 +1,19 @@
|
||||
2
|
||||
7
|
||||
5
|
||||
-1
|
||||
8
|
||||
8
|
||||
4
|
||||
-4
|
||||
6
|
||||
4
|
||||
3
|
||||
7
|
||||
8
|
||||
4
|
||||
4
|
||||
1
|
||||
3
|
||||
1
|
||||
16838
|
||||
26
tests/core_bitops.sl
Normal file
26
tests/core_bitops.sl
Normal file
@@ -0,0 +1,26 @@
|
||||
import ../stdlib/stdlib.sl
|
||||
import ../stdlib/io.sl
|
||||
|
||||
word main
|
||||
6 3 band puti cr
|
||||
6 3 bor puti cr
|
||||
6 3 bxor puti cr
|
||||
0 bnot puti cr
|
||||
1 3 shl puti cr
|
||||
1 3 sal puti cr
|
||||
8 1 shr puti cr
|
||||
8 neg 1 sar puti cr
|
||||
5 inc puti cr
|
||||
5 dec puti cr
|
||||
3 7 min puti cr
|
||||
3 7 max puti cr
|
||||
1 3 rol puti cr
|
||||
8 1 ror puti cr
|
||||
5 1 4 clamp puti cr
|
||||
0 1 4 clamp puti cr
|
||||
3 1 4 clamp puti cr
|
||||
time 0 > puti cr
|
||||
1 mem swap !
|
||||
rand puti cr
|
||||
0
|
||||
end
|
||||
1
tests/core_bitops.test
Normal file
1
tests/core_bitops.test
Normal file
@@ -0,0 +1 @@
|
||||
python main.py tests/core_bitops.sl -o ./build/core_bitops > /dev/null && ./build/core_bitops
|
||||
Reference in New Issue
Block a user