From dc88864c9742029c2980fc16cd2c9e6f04ff3568 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 27 Jul 2021 17:08:37 -0700 Subject: stage2: implement `@boolToInt` This is the first commit in which some behavior tests are passing for both stage1 and stage2. --- src/AstGen.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/AstGen.zig') diff --git a/src/AstGen.zig b/src/AstGen.zig index 34f906fab1..b5e5d60b2c 100644 --- a/src/AstGen.zig +++ b/src/AstGen.zig @@ -7754,6 +7754,7 @@ pub const simple_types = std.ComptimeStringMap(Zir.Inst.Ref, .{ .{ "u32", .u32_type }, .{ "u64", .u64_type }, .{ "u128", .u128_type }, + .{ "u1", .u1_type }, .{ "u8", .u8_type }, .{ "undefined", .undef }, .{ "usize", .usize_type }, @@ -8400,6 +8401,7 @@ fn rvalue( const as_usize = @as(u64, @enumToInt(Zir.Inst.Ref.usize_type)) << 32; const as_void = @as(u64, @enumToInt(Zir.Inst.Ref.void_type)) << 32; switch ((@as(u64, @enumToInt(ty_inst)) << 32) | @as(u64, @enumToInt(result))) { + as_ty | @enumToInt(Zir.Inst.Ref.u1_type), as_ty | @enumToInt(Zir.Inst.Ref.u8_type), as_ty | @enumToInt(Zir.Inst.Ref.i8_type), as_ty | @enumToInt(Zir.Inst.Ref.u16_type), -- cgit v1.2.3