diff options
Diffstat (limited to 'tests/vm/ttouintconv.nim')
-rw-r--r-- | tests/vm/ttouintconv.nim | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/tests/vm/ttouintconv.nim b/tests/vm/ttouintconv.nim index cd25ffb00..8c43a3adb 100644 --- a/tests/vm/ttouintconv.nim +++ b/tests/vm/ttouintconv.nim @@ -1,7 +1,7 @@ import macros discard """ -msg: ''' +nimout: ''' 8 9 17 239 255 61439 65534 65535 @@ -20,7 +20,7 @@ msg: ''' #bug #2514 -macro foo(): stmt = +macro foo() = var x = 8'u8 var y = 9'u16 var z = 17'u32 @@ -57,21 +57,28 @@ macro foo(): stmt = var zz = 0x7FFFFFFF'u32 echo zz - -macro foo2(): stmt = + +macro foo2() = var xx = 0x7FFFFFFFFFFFFFFF echo xx - + var yy = 0 echo yy - + var zz = 0x80'u8 echo zz - + var ww = -9 - var vv = ww.uint - var kk = vv.uint32 + var vv = cast[uint](ww) + var kk = cast[uint32](vv) echo kk - + foo() foo2() + +block: + const neg5VM = block: + let x = -5'i8 + uint64(x) + let y = -5'i8 + doAssert uint64(y) == neg5VM |