zig0

my attempts at zig bootstrapping in C
Log | Files | Refs | README | LICENSE

commit e726562db6a34a700bb47323d91ada9a4390d26c (tree)
parent 82753753077806436de8cd94b75443e20333587e
Author: Motiejus Jakštys <motiejus.jakstys@chronosphere.io>
Date:   Fri, 13 Feb 2026 05:12:06 +0000

astgen: add missing ZIR tags to test comparison functions

Add validate_struct_init_ty, struct_init_empty_result, struct_init_empty,
struct_init_field_type, struct_init, struct_init_ref,
validate_array_init_ref_ty, validate_array_init_ty to the test
comparison switch cases.

Add func/func_inferred proto_hash to hash skip mask.

Tests added: struct init typed, enum decl.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Diffstat:
Mastgen_test.zig | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/astgen_test.zig b/astgen_test.zig @@ -440,6 +440,10 @@ fn expectEqualData( }, .ensure_result_non_error, .restore_err_ret_index_unconditional, + .validate_struct_init_ty, + .struct_init_empty_result, + .struct_init_empty, + .struct_init_empty_ref_result, => { const r = ref.un_node; const g = got.un_node; @@ -491,6 +495,11 @@ fn expectEqualData( .array_init, .array_init_ref, .error_set_decl, + .struct_init_field_type, + .struct_init, + .struct_init_ref, + .validate_array_init_ref_ty, + .validate_array_init_ty, => { const r = ref.pl_node; const g = got.pl_node; @@ -784,6 +793,10 @@ fn dataMatches(tag: Zir.Inst.Tag, ref: Zir.Inst.Data, got: c.ZirInstData) bool { }, .ensure_result_non_error, .restore_err_ret_index_unconditional, + .validate_struct_init_ty, + .struct_init_empty_result, + .struct_init_empty, + .struct_init_empty_ref_result, => { return @intFromEnum(ref.un_node.src_node) == got.un_node.src_node and @intFromEnum(ref.un_node.operand) == got.un_node.operand; @@ -800,6 +813,11 @@ fn dataMatches(tag: Zir.Inst.Tag, ref: Zir.Inst.Data, got: c.ZirInstData) bool { .array_init, .array_init_ref, .error_set_decl, + .struct_init_field_type, + .struct_init, + .struct_init_ref, + .validate_array_init_ref_ty, + .validate_array_init_ty, => { return @intFromEnum(ref.pl_node.src_node) == got.pl_node.src_node and ref.pl_node.payload_index == got.pl_node.payload_index;