summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
authorGULPF <oscarnihlgard@gmail.com>2018-01-31 16:29:42 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-01-31 16:29:42 +0100
commit94038545bec1bffa9bf045be8a5e52b79e9f217c (patch)
treee3b9cf0915442772c3405b561e6455b5b36c4957 /tests/ccgbugs
parentb5538990a2f0260b1ab04df3c73ecf9a7f927ad2 (diff)
downloadNim-94038545bec1bffa9bf045be8a5e52b79e9f217c.tar.gz
Fixes codegen bug with literal negative zero, fixes #7079 (#7158)
* Fixes #7079

* Fix handling of neg zero during constant folding
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r--tests/ccgbugs/t7079.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ccgbugs/t7079.nim b/tests/ccgbugs/t7079.nim
new file mode 100644
index 000000000..bfa1b77a6
--- /dev/null
+++ b/tests/ccgbugs/t7079.nim
@@ -0,0 +1,9 @@
+discard """
+  action: run
+  targets: '''c js'''
+"""
+
+import math
+let x = -0.0
+doAssert classify(x) == fcNegZero
+doAssert classify(1 / -0.0) == fcNegInf
\ No newline at end of file