diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-02-26 15:19:13 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-02-26 16:50:35 -0700 |
| commit | 822d29286bd39b7331970e1e641ad240e7b62aee (patch) | |
| tree | 2dd08b9a7d8406e79af61d074d7172196ea0ec7a /test/behavior/math.zig | |
| parent | e81b21a0ea955422835fb42a14bfa2db6bd74146 (diff) | |
| download | zig-822d29286bd39b7331970e1e641ad240e7b62aee.tar.gz zig-822d29286bd39b7331970e1e641ad240e7b62aee.zip | |
Sema: make `align(a) T` same as `align(a:0:N) T`
where `@sizeOf(T) == N`.
Diffstat (limited to 'test/behavior/math.zig')
| -rw-r--r-- | test/behavior/math.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/behavior/math.zig b/test/behavior/math.zig index fe5329ec81..597d004262 100644 --- a/test/behavior/math.zig +++ b/test/behavior/math.zig @@ -488,6 +488,12 @@ const DivResult = struct { remainder: u64, }; +test "bit shift a u1" { + var x: u1 = 1; + var y = x << 0; + try expect(y == 1); +} + test "truncating shift right" { try testShrTrunc(maxInt(u16)); comptime try testShrTrunc(maxInt(u16)); |
