diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-09-16 11:23:38 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-09-16 11:23:38 -0400 |
| commit | dd5b2d1b04197903489f5da9c178e17e61bb55e3 (patch) | |
| tree | 4c0e4cfd9774163cb0412e8f0b8edb7dc5756dfd /test | |
| parent | 780e5674467ebac4534cd3d3f2199ccaf1d0922c (diff) | |
| download | zig-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.zig | 9 |
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 {} |
