aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 5eb009dafa..a6e2d0b98f 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -7411,4 +7411,12 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
, &[_][]const u8{
":5:28: error: expected type '[]u8', found '*const [3:0]u8'",
});
+
+ cases.add("integer underflow error",
+ \\export fn entry() void {
+ \\ _ = @intToPtr(*c_void, ~@as(usize, @import("std").math.maxInt(usize)) - 1);
+ \\}
+ , &[_][]const u8{
+ ":2:75: error: operation caused overflow",
+ });
}