diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-09-19 17:06:57 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-09-20 00:50:13 +0300 |
| commit | 540130650f843f0c6aa79c2a2f29e79b33846994 (patch) | |
| tree | 9f72ec5bff096277d8b65550f65a079e518c97e8 /test/behavior/align.zig | |
| parent | 541b3e3a31946475f29d21e7a742bf80c5952791 (diff) | |
| download | zig-540130650f843f0c6aa79c2a2f29e79b33846994.tar.gz zig-540130650f843f0c6aa79c2a2f29e79b33846994.zip | |
Sema: pass calculated offset to `elemPtrType` in `elemPtrSlice`
Diffstat (limited to 'test/behavior/align.zig')
| -rw-r--r-- | test/behavior/align.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/behavior/align.zig b/test/behavior/align.zig index 51481580cf..5270aa9692 100644 --- a/test/behavior/align.zig +++ b/test/behavior/align.zig @@ -564,3 +564,8 @@ test "@alignCast null" { const aligned: ?*anyopaque = @alignCast(@alignOf(?*anyopaque), ptr); try expect(aligned == null); } + +test "alignment of slice element" { + const a: []align(1024) const u8 = undefined; + try expect(@TypeOf(&a[0]) == *align(1024) const u8); +} |
