| author | |
| committer | |
| log | 8b66443d5008be91756c3c5567548ed18766ea11 |
| tree | 166c32f3c7eeb9033a4d882036f29d717ed00cca |
| parent | d9490a4340366818f91fac428981fe662d552ca6 |
The test builds an object file to prevent StackTrace from already having
been analyzed by other code.
Fixes #130304 files changed, 29 insertions(+), 0 deletions(-)
src/codegen/llvm.zig+1| ... | ... | @@ -2335,6 +2335,7 @@ pub const Object = struct { |
| 2335 | 2335 | const stack_trace_decl = builtin_namespace.decls |
| 2336 | 2336 | .getKeyAdapted(stack_trace_str, Module.DeclAdapter{ .mod = mod }).?; |
| 2337 | 2337 | |
| 2338 | mod.ensureDeclAnalyzed(stack_trace_decl) catch unreachable; | |
| 2338 | 2339 | return mod.declPtr(stack_trace_decl).val.toType(undefined); |
| 2339 | 2340 | } |
| 2340 | 2341 | }; |
test/standalone.zig+2| ... | ... | @@ -97,4 +97,6 @@ pub fn addCases(cases: *tests.StandaloneContext) void { |
| 97 | 97 | // Disabled due to tripping LLVM 13 assertion: |
| 98 | 98 | // https://github.com/ziglang/zig/issues/12015 |
| 99 | 99 | //cases.add("tools/update_spirv_features.zig"); |
| 100 | ||
| 101 | cases.addBuildFile("test/standalone/issue_13030/build.zig", .{ .build_modes = true }); | |
| 100 | 102 | } |
test/standalone/issue_13030/build.zig created+18| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | const std = @import("std"); | |
| 2 | const builtin = @import("builtin"); | |
| 3 | const Builder = std.build.Builder; | |
| 4 | const CrossTarget = std.zig.CrossTarget; | |
| 5 | ||
| 6 | pub fn build(b: *Builder) void { | |
| 7 | const mode = b.standardReleaseOptions(); | |
| 8 | const target = b.standardTargetOptions(.{}); | |
| 9 | ||
| 10 | const obj = b.addObject("main", "main.zig"); | |
| 11 | obj.setBuildMode(mode); | |
| 12 | ||
| 13 | obj.setTarget(target); | |
| 14 | b.default_step.dependOn(&obj.step); | |
| 15 | ||
| 16 | const test_step = b.step("test", "Test the program"); | |
| 17 | test_step.dependOn(&obj.step); | |
| 18 | } |
test/standalone/issue_13030/main.zig created+8| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | const std = @import("std"); | |
| 2 | fn a() error{}!void {} | |
| 3 | fn b() std.meta.FnPtr(fn () error{}!void) { | |
| 4 | return &a; | |
| 5 | } | |
| 6 | export fn c() void { | |
| 7 | _ = b(); | |
| 8 | } |