summary refs log tree commit diff stats
path: root/tests/vm/ttouintconv.nim
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-06-25 01:01:08 +0300
committerGitHub <noreply@github.com>2023-06-25 00:01:08 +0200
commitf718f295df3f6ee5d7fd6fc19e39ac663821b00a (patch)
tree3ed631793cd2d838ad4909afa51770b28864cb14 /tests/vm/ttouintconv.nim
parentc6c85f84db3bd7bd2d1c5823020c7df007f1bb69 (diff)
downloadNim-f718f295df3f6ee5d7fd6fc19e39ac663821b00a.tar.gz
fix VM uint conversion size bug, stricter int gen on JS (#22150)
* fix VM uint conversion bug, stricter int gen on JS

fixes #19929

* fix float -> uint64 conversion too

* no need to mask to source type

* simpler diff with explanation, add test for described issue
Diffstat (limited to 'tests/vm/ttouintconv.nim')
-rw-r--r--tests/vm/ttouintconv.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/vm/ttouintconv.nim b/tests/vm/ttouintconv.nim
index ff2187a36..8c43a3adb 100644
--- a/tests/vm/ttouintconv.nim
+++ b/tests/vm/ttouintconv.nim
@@ -75,3 +75,10 @@ macro foo2() =
 
 foo()
 foo2()
+
+block:
+  const neg5VM = block:
+    let x = -5'i8
+    uint64(x)
+  let y = -5'i8
+  doAssert uint64(y) == neg5VM