mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
test/link: update wasm linker tests
Disable garbage-collection for certain tests to ensure the tested sections are being emitted.
This commit is contained in:
parent
596d1cd5a8
commit
4115f70cd3
@ -26,6 +26,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt
|
||||
lib.strip = false;
|
||||
// to make sure the bss segment is emitted, we must import memory
|
||||
lib.import_memory = true;
|
||||
lib.link_gc_sections = false;
|
||||
|
||||
const check_lib = lib.checkObject();
|
||||
|
||||
@ -73,6 +74,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt
|
||||
lib.strip = false;
|
||||
// to make sure the bss segment is emitted, we must import memory
|
||||
lib.import_memory = true;
|
||||
lib.link_gc_sections = false;
|
||||
|
||||
const check_lib = lib.checkObject();
|
||||
check_lib.checkStart();
|
||||
|
||||
@ -23,6 +23,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
||||
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",
|
||||
@ -34,6 +35,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
||||
export_table.use_llvm = false;
|
||||
export_table.use_lld = false;
|
||||
export_table.export_table = true;
|
||||
export_table.link_gc_sections = false;
|
||||
|
||||
const regular_table = b.addExecutable(.{
|
||||
.name = "regular_table",
|
||||
@ -44,6 +46,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
||||
regular_table.entry = .disabled;
|
||||
regular_table.use_llvm = false;
|
||||
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();
|
||||
|
||||
@ -23,6 +23,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
||||
lib.use_llvm = false;
|
||||
lib.use_lld = false;
|
||||
lib.strip = false;
|
||||
lib.link_gc_sections = false; // so data is not garbage collected and we can verify data section
|
||||
b.installArtifact(lib);
|
||||
|
||||
const check_lib = lib.checkObject();
|
||||
|
||||
@ -24,6 +24,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
|
||||
lib.use_lld = false;
|
||||
lib.strip = false;
|
||||
lib.stack_size = std.wasm.page_size * 2; // set an explicit stack size
|
||||
lib.link_gc_sections = false;
|
||||
b.installArtifact(lib);
|
||||
|
||||
const check_lib = lib.checkObject();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user