summary refs log tree commit diff stats
path: root/tests/vm/toverflowopcsubint.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm/toverflowopcsubint.nim')
-rw-r--r--tests/vm/toverflowopcsubint.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/vm/toverflowopcsubint.nim b/tests/vm/toverflowopcsubint.nim
new file mode 100644
index 000000000..8d114f200
--- /dev/null
+++ b/tests/vm/toverflowopcsubint.nim
@@ -0,0 +1,12 @@
+discard """
+  errormsg: "over- or underflow"
+"""
+
+static:
+  proc p =
+    var
+      x = int64.low
+      y = 1
+    discard x - y
+    assert false
+  p()