aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cases/no_compile_panic_for_unchecked_arith.zig16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/cases/no_compile_panic_for_unchecked_arith.zig b/test/cases/no_compile_panic_for_unchecked_arith.zig
new file mode 100644
index 0000000000..a9aa8272b1
--- /dev/null
+++ b/test/cases/no_compile_panic_for_unchecked_arith.zig
@@ -0,0 +1,16 @@
+pub const panic = @compileError("");
+
+export fn entry() usize {
+ var x: usize = 0;
+ x +%= 1;
+ x -%= 1;
+ x *%= 2;
+ x +|= 1;
+ x -|= 1;
+ x *|= 2;
+ return x;
+}
+
+// compile
+// output_mode=Obj
+// backend=stage2,llvm