summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-desktop>2009-12-14 01:38:05 +0100
committerAndreas Rumpf <andreas@andreas-desktop>2009-12-14 01:38:05 +0100
commit3b7ef2288f60bc5c355ad9aeaa127431ec3aee7b (patch)
tree5e028b11cf337290942b3cf6ecc599854de36747 /tests
parent911c1cb301a8483e463772b785b0aee79cf2a68c (diff)
downloadNim-3b7ef2288f60bc5c355ad9aeaa127431ec3aee7b.tar.gz
floating point checks
Diffstat (limited to 'tests')
-rwxr-xr-xtests/99bottles.nim1
-rwxr-xr-xtests/tfloat1.nim8
-rwxr-xr-xtests/tfloat2.nim8
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/99bottles.nim b/tests/99bottles.nim
new file mode 100755
index 000000000..14904ac0f
--- /dev/null
+++ b/tests/99bottles.nim
@@ -0,0 +1 @@
+# Test if the compiler detects invalid module names
diff --git a/tests/tfloat1.nim b/tests/tfloat1.nim
new file mode 100755
index 000000000..89911dd61
--- /dev/null
+++ b/tests/tfloat1.nim
@@ -0,0 +1,8 @@
+# Test new floating point exceptions
+
+{.floatChecks: on.}
+
+var x = 0.8
+var y = 0.0
+
+echo x / y #OUT Error: unhandled exception: FPU operation caused an overflow [EFloatOverflow]
diff --git a/tests/tfloat2.nim b/tests/tfloat2.nim
new file mode 100755
index 000000000..92421d446
--- /dev/null
+++ b/tests/tfloat2.nim
@@ -0,0 +1,8 @@
+# Test new floating point exceptions
+
+{.floatChecks: on.}
+
+var x = 0.0
+var y = 0.0
+
+echo x / y #OUT Error: unhandled exception: FPU operation caused a NaN result [EFloatInvalidOp]