diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-09-18 09:49:57 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-09-18 09:49:57 -0400 |
| commit | d353d5aef8bfc5c701ab8958751ef74f6704342b (patch) | |
| tree | ebdd1d8f385db5056c903cc74f1ebf3f1f381b1d /test | |
| parent | 68c1d059178a36add751e97e11cee004cfdf612e (diff) | |
| download | zig-d353d5aef8bfc5c701ab8958751ef74f6704342b.tar.gz zig-d353d5aef8bfc5c701ab8958751ef74f6704342b.zip | |
fix @bytesToSlice on a packed struct
closes #1551
Diffstat (limited to 'test')
| -rw-r--r-- | test/cases/eval.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cases/eval.zig b/test/cases/eval.zig index 5f456364a5..acb3da72c7 100644 --- a/test/cases/eval.zig +++ b/test/cases/eval.zig @@ -700,3 +700,13 @@ test "@intCast to a u0" { var y: u0 = @intCast(u0, x); assert(y == 0); } + +test "@bytesToslice on a packed struct" { + const F = packed struct { + a: u8, + }; + + var b = [1]u8{9}; + var f = @bytesToSlice(F, b); + assert(f[0].a == 9); +} |
