Commit ec5fc6a2a8
Changed files (1)
test
link
wasm
function-table
test/link/wasm/function-table/build.zig
@@ -7,26 +7,9 @@ pub fn build(b: *std.Build) void {
b.default_step = test_step;
add(b, test_step, .Debug);
- add(b, test_step, .ReleaseFast);
- add(b, test_step, .ReleaseSmall);
- add(b, test_step, .ReleaseSafe);
}
fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void {
- const import_table = b.addExecutable(.{
- .name = "import_table",
- .root_module = b.createModule(.{
- .root_source_file = b.path("lib.zig"),
- .target = b.resolveTargetQuery(.{ .cpu_arch = .wasm32, .os_tag = .freestanding }),
- .optimize = optimize,
- }),
- });
- import_table.entry = .disabled;
- import_table.use_llvm = false;
- import_table.use_lld = false;
- import_table.import_table = true;
- import_table.link_gc_sections = false;
-
const export_table = b.addExecutable(.{
.name = "export_table",
.root_module = b.createModule(.{
@@ -54,21 +37,9 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
regular_table.use_lld = false;
regular_table.link_gc_sections = false; // Ensure function table is not empty
- const check_import = import_table.checkObject();
const check_export = export_table.checkObject();
const check_regular = regular_table.checkObject();
- check_import.checkInHeaders();
- check_import.checkExact("Section import");
- check_import.checkExact("entries 1");
- check_import.checkExact("module env");
- check_import.checkExact("name __indirect_function_table");
- check_import.checkExact("kind table");
- check_import.checkExact("type funcref");
- check_import.checkExact("min 1"); // 1 function pointer
- check_import.checkNotPresent("max"); // when importing, we do not provide a max
- check_import.checkNotPresent("Section table"); // we're importing it
-
check_export.checkInHeaders();
check_export.checkExact("Section export");
check_export.checkExact("entries 2");
@@ -89,7 +60,6 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
check_regular.checkExact("i32.const 1"); // we want to start function indexes at 1
check_regular.checkExact("indexes 1"); // 1 function pointer
- test_step.dependOn(&check_import.step);
test_step.dependOn(&check_export.step);
test_step.dependOn(&check_regular.step);
}