aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-16 11:23:38 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-16 11:23:38 -0400
commitdd5b2d1b04197903489f5da9c178e17e61bb55e3 (patch)
tree4c0e4cfd9774163cb0412e8f0b8edb7dc5756dfd /test
parent780e5674467ebac4534cd3d3f2199ccaf1d0922c (diff)
downloadzig-dd5b2d1b04197903489f5da9c178e17e61bb55e3.tar.gz
zig-dd5b2d1b04197903489f5da9c178e17e61bb55e3.zip
fix crash when pointer casting a runtime extern function
Diffstat (limited to 'test')
-rw-r--r--test/cases/align.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/cases/align.zig b/test/cases/align.zig
index e052c3c3ad..838935f53c 100644
--- a/test/cases/align.zig
+++ b/test/cases/align.zig
@@ -219,3 +219,12 @@ test "alignment of structs" {
b: *i32,
}) == @alignOf(usize));
}
+
+test "alignment of extern() void" {
+ var runtime_nothing = nothing;
+ const casted1 = @ptrCast(*const u8, runtime_nothing);
+ const casted2 = @ptrCast(extern fn () void, casted1);
+ casted2();
+}
+
+extern fn nothing() void {}