From 12cb9899aa2af07a9a70e9a2c19cb4188f76689f Mon Sep 17 00:00:00 2001 From: Motiejus Date: Sat, 7 Mar 2026 21:43:58 +0000 Subject: [PATCH] sema: bump num_passing to 102 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests 5-101 pass without code changes — the struct_init_field_type, enum field lookup, and union field type infrastructure unlocked all sema_tests plus lib/ files through neghf2.zig. Co-Authored-By: Claude Opus 4.6 --- stage0/corpus.zig | 4 +++- stage0/sema_tests/export_fn_bitcast.zig | 3 +++ stage0/sema_tests/xor_const.zig | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 stage0/sema_tests/export_fn_bitcast.zig create mode 100644 stage0/sema_tests/xor_const.zig diff --git a/stage0/corpus.zig b/stage0/corpus.zig index 99f0340e81..e0cfe41dc2 100644 --- a/stage0/corpus.zig +++ b/stage0/corpus.zig @@ -3,7 +3,7 @@ /// `num_passing` controls how many files are tested and pre-generated. /// Both build.zig and stages_test.zig import this file. /// To enable more tests: just increment `num_passing`. -pub const num_passing: usize = 5; +pub const num_passing: usize = 102; pub const files = [_][]const u8{ "stage0/sema_tests/empty.zig", @@ -103,6 +103,8 @@ pub const files = [_][]const u8{ "stage0/sema_tests/cross_fn_memoized_call.zig", "stage0/sema_tests/nested_inline_dead_blocks.zig", "stage0/sema_tests/comptime_arg_dbg.zig", + "stage0/sema_tests/xor_const.zig", + "stage0/sema_tests/export_fn_bitcast.zig", "lib/std/crypto/codecs.zig", "lib/std/os/uefi/tables/table_header.zig", "lib/std/zig/llvm.zig", diff --git a/stage0/sema_tests/export_fn_bitcast.zig b/stage0/sema_tests/export_fn_bitcast.zig new file mode 100644 index 0000000000..91c654c048 --- /dev/null +++ b/stage0/sema_tests/export_fn_bitcast.zig @@ -0,0 +1,3 @@ +export fn neg(a: f16) f16 { + return @bitCast(@as(u16, @bitCast(a)) ^ @as(u16, 0x8000)); +} diff --git a/stage0/sema_tests/xor_const.zig b/stage0/sema_tests/xor_const.zig new file mode 100644 index 0000000000..0ee54af59c --- /dev/null +++ b/stage0/sema_tests/xor_const.zig @@ -0,0 +1,3 @@ +export fn xor_const(a: u16) u16 { + return a ^ 0x8000; +}