diff options
| author | LemonBoy <thatlemon@gmail.com> | 2020-11-01 22:14:08 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-11-02 13:40:00 -0500 |
| commit | be26c3bf4e4c6a7654ea68e6606c1167ef969a09 (patch) | |
| tree | 7aa5e1e1f9795f7aa1d01ff970ea22e9dd901d00 /test | |
| parent | ad9655db3a0e831f8e88bc902db7363547f9a12b (diff) | |
| download | zig-be26c3bf4e4c6a7654ea68e6606c1167ef969a09.tar.gz zig-be26c3bf4e4c6a7654ea68e6606c1167ef969a09.zip | |
stage1: Fix *WithOverflow intrinsics with u0 values
Closes #5369
Diffstat (limited to 'test')
| -rw-r--r-- | test/stage1/behavior/math.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/stage1/behavior/math.zig b/test/stage1/behavior/math.zig index b13b1ce1e0..68690c9af8 100644 --- a/test/stage1/behavior/math.zig +++ b/test/stage1/behavior/math.zig @@ -109,6 +109,14 @@ test "@shlWithOverflow" { expect(result == 0b1011111111111100); } +test "@*WithOverflow with u0 values" { + var result: u0 = undefined; + expect(!@addWithOverflow(u0, 0, 0, &result)); + expect(!@subWithOverflow(u0, 0, 0, &result)); + expect(!@mulWithOverflow(u0, 0, 0, &result)); + expect(!@shlWithOverflow(u0, 0, 0, &result)); +} + test "@clz" { testClz(); comptime testClz(); |
