ir done'ish

This commit is contained in:
agra
2026-03-01 22:38:41 +02:00
parent 6a920dbd2c
commit f763765ea2
17 changed files with 1443 additions and 15017 deletions

View File

@@ -437,7 +437,7 @@ test "emit: struct_gep (pointer to field)" {
b.switchToBlock(entry);
const p_ptr = b.alloca(point_ty);
const y_ptr = b.structGep(p_ptr, 1, ptr_s64);
const y_ptr = b.structGepTyped(p_ptr, 1, ptr_s64, point_ty);
const c42 = b.constInt(42, .s64);
b.store(y_ptr, c42);
const loaded = b.load(y_ptr, .s64);
@@ -482,7 +482,7 @@ test "emit: enum_init and enum_tag (plain enum)" {
b.switchToBlock(entry);
const green = b.enumInit(1, Ref.none, color_ty); // Green = tag 1
const tag = b.enumTag(green);
const tag = b.enumTag(green, .s32);
// Widen tag from s32 to s64 for the return
const wide = b.widen(tag, .s32, .s64);
b.ret(wide, .s64);
@@ -511,10 +511,10 @@ test "emit: tagged union (enum_init with payload, enum_tag, enum_payload)" {
};
const owned_ufields = alloc.dupe(types.TypeInfo.StructInfo.Field, ufields) catch unreachable;
defer alloc.free(owned_ufields);
const shape_ty = module.types.intern(.{ .@"union" = .{
const shape_ty = module.types.intern(.{ .tagged_union = .{
.name = str(&module, "Shape"),
.fields = owned_ufields,
.tag_type = null,
.tag_type = .s64,
} });
var b = Builder.init(&module);
@@ -558,7 +558,6 @@ test "emit: union_get (reinterpret union field)" {
const data_ty = module.types.intern(.{ .@"union" = .{
.name = str(&module, "Data"),
.fields = owned_ufields,
.tag_type = null,
} });
var b = Builder.init(&module);