diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-06-10 05:26:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-10 05:26:59 -0400 |
| commit | fcfeafe99a3ecc694a3475735c81a0d75b6da6d0 (patch) | |
| tree | 55eefb8b42d39c7ead40f9a92e5c494c9b2226b1 /test/behavior | |
| parent | 5816d3eaec3f3bb04e70c89aa402ba9e0e5e7b2c (diff) | |
| parent | 436aafd3e2ef1a8f5998b974a9791b59939f57ad (diff) | |
| download | zig-fcfeafe99a3ecc694a3475735c81a0d75b6da6d0.tar.gz zig-fcfeafe99a3ecc694a3475735c81a0d75b6da6d0.zip | |
Merge pull request #11819 from ziglang/std.debug.Trace
introduce std.debug.Trace and use it to debug a LazySrcLoc in stage2 that is set to a bogus value
Diffstat (limited to 'test/behavior')
| -rw-r--r-- | test/behavior/bugs/920.zig | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/test/behavior/bugs/920.zig b/test/behavior/bugs/920.zig index 19fce71549..7dae996dac 100644 --- a/test/behavior/bugs/920.zig +++ b/test/behavior/bugs/920.zig @@ -1,14 +1,24 @@ +const builtin = @import("builtin"); const std = @import("std"); const Random = std.rand.Random; +const zeroCaseFn = switch (builtin.zig_backend) { + .stage1 => fn (*Random, f64) f64, + else => *const fn (*Random, f64) f64, +}; +const pdfFn = switch (builtin.zig_backend) { + .stage1 => fn (f64) f64, + else => *const fn (f64) f64, +}; + const ZigTable = struct { r: f64, x: [257]f64, f: [257]f64, - pdf: fn (f64) f64, + pdf: pdfFn, is_symmetric: bool, - zero_case: fn (*Random, f64) f64, + zero_case: zeroCaseFn, }; fn ZigTableGen(comptime is_symmetric: bool, comptime r: f64, comptime v: f64, comptime f: fn (f64) f64, comptime f_inv: fn (f64) f64, comptime zero_case: fn (*Random, f64) f64) ZigTable { @@ -56,7 +66,11 @@ const NormalDist = blk: { }; test "bug 920 fixed" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO const NormalDist1 = blk: { break :blk ZigTableGen(true, norm_r, norm_v, norm_f, norm_f_inv, norm_zero_case); |
