authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-14 20:10:15-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-15 15:11:37-08:00
logae119e395a08652f441a97507f3a6489e10246e3
tree1b1a96eee4b4cf10c8a58335b6ece495796d884a
parentc565191f30967ede72da06b7ad30cffdf25bf29e

test/link/wasm/segment: delete bad test

- doesn't run the exe - checks for data segment named .rodata which is not a thing - checks for data segment named .bss which is not needed

3 files changed, 0 insertions(+), 60 deletions(-)

test/link/build.zig.zon-3
...@@ -45,9 +45,6 @@...@@ -45,9 +45,6 @@
45 .wasm_producers = .{45 .wasm_producers = .{
46 .path = "wasm/producers",46 .path = "wasm/producers",
47 },47 },
48 .wasm_segments = .{
49 .path = "wasm/segments",
50 },
51 .wasm_shared_memory = .{48 .wasm_shared_memory = .{
52 .path = "wasm/shared-memory",49 .path = "wasm/shared-memory",
53 },50 },
test/link/wasm/segments/build.zig deleted-48
...@@ -1,48 +0,0 @@
1const std = @import("std");
2
3pub const requires_stage2 = true;
4
5pub fn build(b: *std.Build) void {
6 const test_step = b.step("test", "Test it");
7 b.default_step = test_step;
8
9 add(b, test_step, .Debug);
10 add(b, test_step, .ReleaseFast);
11 add(b, test_step, .ReleaseSmall);
12 add(b, test_step, .ReleaseSafe);
13}
14
15fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void {
16 const lib = b.addExecutable(.{
17 .name = "lib",
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 .strip = false,
23 }),
24 });
25 lib.entry = .disabled;
26 lib.use_llvm = false;
27 lib.use_lld = false;
28 lib.link_gc_sections = false; // so data is not garbage collected and we can verify data section
29 b.installArtifact(lib);
30
31 const check_lib = lib.checkObject();
32 check_lib.checkInHeaders();
33 check_lib.checkExact("Section data");
34 check_lib.checkExact("entries 2"); // rodata & data, no bss because we're exporting memory
35
36 check_lib.checkInHeaders();
37 check_lib.checkExact("Section custom");
38 check_lib.checkInHeaders();
39 check_lib.checkExact("name name"); // names custom section
40 check_lib.checkInHeaders();
41 check_lib.checkExact("type data_segment");
42 check_lib.checkExact("names 2");
43 check_lib.checkExact("index 0");
44 check_lib.checkExact("name .rodata");
45 check_lib.checkExact("index 1");
46 check_lib.checkExact("name .data");
47 test_step.dependOn(&check_lib.step);
48}
test/link/wasm/segments/lib.zig deleted-9
...@@ -1,9 +0,0 @@
1pub const rodata: u32 = 5;
2pub var data: u32 = 10;
3pub var bss: u32 = undefined;
4
5export fn foo() void {
6 _ = rodata;
7 _ = data;
8 _ = bss;
9}