summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/tvmops.nim5
-rw-r--r--tests/vm/tzero_extend.nim12
2 files changed, 11 insertions, 6 deletions
diff --git a/tests/vm/tvmops.nim b/tests/vm/tvmops.nim
index c9caaf32b..6442c49d6 100644
--- a/tests/vm/tvmops.nim
+++ b/tests/vm/tvmops.nim
@@ -40,6 +40,11 @@ static:
     let a2 = arcsin 0.3
     doAssert a1 == a2
 
+  block bitxor:
+    let x = -1'i32
+    let y = 1'i32
+    doAssert (x xor y) == -2
+
 block:
   # Check against bugs like #9176
   doAssert getCurrentCompilerExe() == forceConst(getCurrentCompilerExe())
diff --git a/tests/vm/tzero_extend.nim b/tests/vm/tzero_extend.nim
index a79105531..76aa9ee67 100644
--- a/tests/vm/tzero_extend.nim
+++ b/tests/vm/tzero_extend.nim
@@ -13,14 +13,14 @@ proc get_values(): (seq[int8], seq[int16], seq[int32]) =
   result[0] = @[]; result[1] = @[]; result[2] = @[]
 
   for offset in RANGE:
-    let i8 = -(1 shl 9) + offset
-    let i16 = -(1 shl 17) + offset
-    let i32 = -(1 shl 33) + offset
+    let i8  = -(1'i64 shl  9) + offset
+    let i16 = -(1'i64 shl 17) + offset
+    let i32 = -(1'i64 shl 33) + offset
 
     # higher bits are masked. these should be exactly equal to offset.
-    result[0].add i8.toU8
-    result[1].add i16.toU16
-    result[2].add i32.toU32
+    result[0].add cast[int8 ](uint8 cast[uint64](i8 ))
+    result[1].add cast[int16](uint16 cast[uint64](i16))
+    result[2].add cast[int32](uint32 cast[uint64](i32))
 
 
 # these values this computed by VM