summaryrefslogtreecommitdiffstats
path: root/src/test/ui/numbers-arithmetic/divide-by-zero.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/numbers-arithmetic/divide-by-zero.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/numbers-arithmetic/divide-by-zero.rs b/src/test/ui/numbers-arithmetic/divide-by-zero.rs
new file mode 100644
index 000000000..30e0e6c1b
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/divide-by-zero.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:attempt to divide by zero
+// ignore-emscripten no processes
+
+#[allow(unconditional_panic)]
+fn main() {
+ let y = 0;
+ let _z = 1 / y;
+}