authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-14 20:22:07-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-15 15:11:37-08:00
logec5fc6a2a8cac1993f1a3fe496377c37b80193ca
tree296362001bcb1c7b77449b6124212e92ed2feaab
parentae119e395a08652f441a97507f3a6489e10246e3

test/link/wasm/function-table: delete bad test

this tests for importing a function table, but the example source does not try to use an imported table, so it's a useless check. it's unclear what the behavior is even supposed to do in this case. the other two cases are left alone.

1 files changed, 0 insertions(+), 30 deletions(-)

test/link/wasm/function-table/build.zig-30
......@@ -7,26 +7,9 @@ pub fn build(b: *std.Build) void {
77 b.default_step = test_step;
88
99 add(b, test_step, .Debug);
10 add(b, test_step, .ReleaseFast);
11 add(b, test_step, .ReleaseSmall);
12 add(b, test_step, .ReleaseSafe);
1310}
1411
1512fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void {
16 const import_table = b.addExecutable(.{
17 .name = "import_table",
18 .root_module = b.createModule(.{
19 .root_source_file = b.path("lib.zig"),
20 .target = b.resolveTargetQuery(.{ .cpu_arch = .wasm32, .os_tag = .freestanding }),
21 .optimize = optimize,
22 }),
23 });
24 import_table.entry = .disabled;
25 import_table.use_llvm = false;
26 import_table.use_lld = false;
27 import_table.import_table = true;
28 import_table.link_gc_sections = false;
29
3013 const export_table = b.addExecutable(.{
3114 .name = "export_table",
3215 .root_module = b.createModule(.{
......@@ -54,21 +37,9 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
5437 regular_table.use_lld = false;
5538 regular_table.link_gc_sections = false; // Ensure function table is not empty
5639
57 const check_import = import_table.checkObject();
5840 const check_export = export_table.checkObject();
5941 const check_regular = regular_table.checkObject();
6042
61 check_import.checkInHeaders();
62 check_import.checkExact("Section import");
63 check_import.checkExact("entries 1");
64 check_import.checkExact("module env");
65 check_import.checkExact("name __indirect_function_table");
66 check_import.checkExact("kind table");
67 check_import.checkExact("type funcref");
68 check_import.checkExact("min 1"); // 1 function pointer
69 check_import.checkNotPresent("max"); // when importing, we do not provide a max
70 check_import.checkNotPresent("Section table"); // we're importing it
71
7243 check_export.checkInHeaders();
7344 check_export.checkExact("Section export");
7445 check_export.checkExact("entries 2");
......@@ -89,7 +60,6 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
8960 check_regular.checkExact("i32.const 1"); // we want to start function indexes at 1
9061 check_regular.checkExact("indexes 1"); // 1 function pointer
9162
92 test_step.dependOn(&check_import.step);
9363 test_step.dependOn(&check_export.step);
9464 test_step.dependOn(&check_regular.step);
9565}