diff options
| author | Veikka Tuominen <git@vexu.eu> | 2023-01-16 15:13:06 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2023-01-17 20:28:43 +0200 |
| commit | 14f03fbd1602dae8fcaa5da42f5769422d1c4a7a (patch) | |
| tree | 5efe70f435efc79416b4b8a7a25fbabb0aa4419f /test/behavior/pointers.zig | |
| parent | 24646b8b5d026a75deb5b3eace0e9142f0719da0 (diff) | |
| download | zig-14f03fbd1602dae8fcaa5da42f5769422d1c4a7a.tar.gz zig-14f03fbd1602dae8fcaa5da42f5769422d1c4a7a.zip | |
AstGen: reset source cursor before generating pointer attributes
These attributes can appear in any order but AstGen expects the source
cursor to be incremented in a monotonically increasing order.
Closes #14332
Diffstat (limited to 'test/behavior/pointers.zig')
| -rw-r--r-- | test/behavior/pointers.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/behavior/pointers.zig b/test/behavior/pointers.zig index e718169731..c8879453ad 100644 --- a/test/behavior/pointers.zig +++ b/test/behavior/pointers.zig @@ -522,3 +522,13 @@ test "ptrToInt on a generic function" { }; try S.doTheTest(&S.generic); } + +test "pointer alignment and element type include call expression" { + const S = struct { + fn T() type { + return struct { _: i32 }; + } + const P = *align(@alignOf(T())) [@sizeOf(T())]u8; + }; + try expect(@alignOf(S.P) > 0); +} |
