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.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 4ed65e449d..1b76c01564 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -2,6 +2,16 @@ const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
+ "bad @alignCast at comptime",
+ \\comptime {
+ \\ const ptr = @intToPtr(*i32, 0x1);
+ \\ const aligned = @alignCast(4, ptr);
+ \\}
+ ,
+ ".tmp_source.zig:3:35: error: pointer address 0x1 is not aligned to 4 bytes",
+ );
+
+ cases.add(
"@ptrToInt on *void",
\\export fn entry() bool {
\\ return @ptrToInt(&{}) == @ptrToInt(&{});