summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-03-09 18:41:39 +0800
committerGitHub <noreply@github.com>2024-03-09 11:41:39 +0100
commitf80a5a30b4a73efb3a7da162f57a259dd69e02c2 (patch)
tree2c4a6e0aea5aacbf6aa0138f9d03381fca445ab6 /tests
parent6ebad30e7a96c67cc7a55aa3248849313c9f4e52 (diff)
downloadNim-f80a5a30b4a73efb3a7da162f57a259dd69e02c2.tar.gz
fixes #23378; fixes js abs negative int64 (#23379)
fixes #23378
Diffstat (limited to 'tests')
-rw-r--r--tests/int/tints.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/int/tints.nim b/tests/int/tints.nim
index a7d27d736..5c071c21d 100644
--- a/tests/int/tints.nim
+++ b/tests/int/tints.nim
@@ -1,5 +1,6 @@
 discard """
   matrix: "; --backend:js --jsbigint64:off; --backend:js --jsbigint64:on"
+  targets: "c js"
   output: '''
 0 0
 0 0
@@ -7,6 +8,8 @@ Success'''
 """
 # Test the different integer operations
 
+# TODO: fixme --backend:js cannot change targets!!!
+
 import std/private/jsutils
 
 var testNumber = 0
@@ -141,4 +144,9 @@ block: # shl
   when not defined(js) or (defined(js) and compileOption("jsbigint64")):
     doAssert u64 shl 1 == u64 - 1
 
+block: # bug #23378
+  var neg = -1  # prevent compile-time evaluation
+  let n = abs BiggestInt neg
+  doAssert n == 1
+
 echo("Success") #OUT Success