diff options
Diffstat (limited to 'tests/micropython')
| -rw-r--r-- | tests/micropython/viper_binop_arith.py | 22 | ||||
| -rw-r--r-- | tests/micropython/viper_binop_arith.py.exp | 10 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/micropython/viper_binop_arith.py b/tests/micropython/viper_binop_arith.py index 137b8c104..d37450315 100644 --- a/tests/micropython/viper_binop_arith.py +++ b/tests/micropython/viper_binop_arith.py @@ -34,3 +34,25 @@ shr(1, 0) shr(1, 3) shr(42, 2) shr(-42, 2) + +@micropython.viper +def and_(x:int, y:int): + print(x & y, y & x) +and_(1, 0) +and_(1, 3) +and_(0xf0, 0x3f) +and_(-42, 6) + +@micropython.viper +def or_(x:int, y:int): + print(x | y, y | x) +or_(1, 0) +or_(1, 2) +or_(-42, 5) + +@micropython.viper +def xor(x:int, y:int): + print(x ^ y, y ^ x) +xor(1, 0) +xor(1, 2) +xor(-42, 5) diff --git a/tests/micropython/viper_binop_arith.py.exp b/tests/micropython/viper_binop_arith.py.exp index f10e998cd..15abcc245 100644 --- a/tests/micropython/viper_binop_arith.py.exp +++ b/tests/micropython/viper_binop_arith.py.exp @@ -23,3 +23,13 @@ 0 10 -11 +0 0 +1 1 +48 48 +6 6 +1 1 +3 3 +-41 -41 +1 1 +3 3 +-45 -45 |
