diff options
| author | Robin Voetter <robin@voetter.nl> | 2024-08-18 15:02:24 +0200 |
|---|---|---|
| committer | Robin Voetter <robin@voetter.nl> | 2024-08-19 19:09:13 +0200 |
| commit | 294ca6563ea5efeec3ab30f27a06c05c2a657f80 (patch) | |
| tree | 22c05ff390958e5e218d4a55e8444f7d54ceb37d /test | |
| parent | b4343074d2d6ee81f8e589395a9c045031b86b83 (diff) | |
| download | zig-294ca6563ea5efeec3ab30f27a06c05c2a657f80.tar.gz zig-294ca6563ea5efeec3ab30f27a06c05c2a657f80.zip | |
add standalone test for only dependending on the emitted assembly and not the bin
Diffstat (limited to 'test')
| -rw-r--r-- | test/standalone/build.zig.zon | 3 | ||||
| -rw-r--r-- | test/standalone/emit_asm_no_bin/build.zig | 19 | ||||
| -rw-r--r-- | test/standalone/emit_asm_no_bin/main.zig | 1 |
3 files changed, 23 insertions, 0 deletions
diff --git a/test/standalone/build.zig.zon b/test/standalone/build.zig.zon index 8e4d727642..f45aa43788 100644 --- a/test/standalone/build.zig.zon +++ b/test/standalone/build.zig.zon @@ -59,6 +59,9 @@ //.issue_12588 = .{ // .path = "issue_12588", //}, + .emit_asm_no_bin = .{ + .path = "emit_asm_no_bin", + }, .child_process = .{ .path = "child_process", }, diff --git a/test/standalone/emit_asm_no_bin/build.zig b/test/standalone/emit_asm_no_bin/build.zig new file mode 100644 index 0000000000..f2f2391bc1 --- /dev/null +++ b/test/standalone/emit_asm_no_bin/build.zig @@ -0,0 +1,19 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const test_step = b.step("test", "Test it"); + b.default_step = test_step; + + const optimize: std.builtin.OptimizeMode = .Debug; + + const obj = b.addObject(.{ + .name = "main", + .root_source_file = b.path("main.zig"), + .optimize = optimize, + .target = b.graph.host, + }); + _ = obj.getEmittedAsm(); + b.default_step.dependOn(&obj.step); + + test_step.dependOn(&obj.step); +} diff --git a/test/standalone/emit_asm_no_bin/main.zig b/test/standalone/emit_asm_no_bin/main.zig new file mode 100644 index 0000000000..902b554db0 --- /dev/null +++ b/test/standalone/emit_asm_no_bin/main.zig @@ -0,0 +1 @@ +pub fn main() void {} |
