aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/eval.zig
diff options
context:
space:
mode:
authorleesongun <12179851+leesongun@users.noreply.github.com>2021-07-13 16:16:57 +0900
committerGitHub <noreply@github.com>2021-07-13 10:16:57 +0300
commit132b18e2b39feca3b90b1b13df2b4649b1661fd5 (patch)
tree12fdd08a6b571f29be3555f8350e53a73da60a1e /test/behavior/eval.zig
parent9086452ff98cf0ec271f449d0824d5b070b26f45 (diff)
downloadzig-132b18e2b39feca3b90b1b13df2b4649b1661fd5.tar.gz
zig-132b18e2b39feca3b90b1b13df2b4649b1661fd5.zip
Fix bigint_shl (#9305)
Diffstat (limited to 'test/behavior/eval.zig')
-rw-r--r--test/behavior/eval.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/behavior/eval.zig b/test/behavior/eval.zig
index 80a3bccb7c..566ed74e2d 100644
--- a/test/behavior/eval.zig
+++ b/test/behavior/eval.zig
@@ -573,6 +573,13 @@ test "comptime shlWithOverflow" {
try expect(ct_shifted == rt_shifted);
}
+test "comptime shl" {
+ var a: u128 = 3;
+ var b: u7 = 63;
+ var c: u128 = 3 << 63;
+ try expectEqual(a << b, c);
+}
+
test "runtime 128 bit integer division" {
var a: u128 = 152313999999999991610955792383;
var b: u128 = 10000000000000000000;