| ... | @@ -452,26 +452,37 @@ pub fn addCases(cases: *@import("tests.zig").ErrorTracesContext, os: std.Target. | ... | @@ -452,26 +452,37 @@ pub fn addCases(cases: *@import("tests.zig").ErrorTracesContext, os: std.Target. |
| 452 | }, | 452 | }, |
| 453 | }); | 453 | }); |
| 454 | | 454 | |
| 455 | // TODO: the standard library has a bug in PDB parsing where given an address corresponding | 455 | cases.addCase(.{ |
| 456 | // to an inline call, the frame we see will be for the *caller*, not the *callee*. As a | 456 | .name = "trace through inline call", |
| 457 | // result this test gives bogus results on Windows right now. | 457 | .source = |
| 458 | // This is a part of https://codeberg.org/ziglang/zig/issues/30847. | 458 | \\pub fn main() !void { |
| 459 | if (os != .windows) { | 459 | \\ try foo(); |
| 460 | cases.addCase(.{ | 460 | \\} |
| 461 | .name = "trace through inline call", | 461 | \\inline fn foo() !void { |
| 462 | .source = | 462 | \\ try bar(); |
| 463 | \\pub fn main() !void { | 463 | \\} |
| 464 | \\ try foo(); | 464 | \\fn bar() !void { |
| 465 | \\} | 465 | \\ return error.ThisIsSoSad; |
| 466 | \\inline fn foo() !void { | 466 | \\} |
| 467 | \\ try bar(); | 467 | , |
| 468 | \\} | 468 | .expect_error = "ThisIsSoSad", |
| 469 | \\fn bar() !void { | 469 | .expect_trace = |
| | 470 | switch (os) { |
| | 471 | // LLVM doesn't emit column info in the binary annotations for inlinee callees in PDBs, |
| | 472 | // so our expected result is slightly different for Windows than on other operating |
| | 473 | // systems. |
| | 474 | .windows => |
| | 475 | \\source.zig:8:5: [address] in bar |
| 470 | \\ return error.ThisIsSoSad; | 476 | \\ return error.ThisIsSoSad; |
| 471 | \\} | 477 | \\ ^ |
| | 478 | \\source.zig:5: [address] in foo |
| | 479 | \\ try bar(); |
| | 480 | \\ |
| | 481 | \\source.zig:2:5: [address] in main |
| | 482 | \\ try foo(); |
| | 483 | \\ ^ |
| 472 | , | 484 | , |
| 473 | .expect_error = "ThisIsSoSad", | 485 | else => |
| 474 | .expect_trace = | | |
| 475 | \\source.zig:8:5: [address] in bar | 486 | \\source.zig:8:5: [address] in bar |
| 476 | \\ return error.ThisIsSoSad; | 487 | \\ return error.ThisIsSoSad; |
| 477 | \\ ^ | 488 | \\ ^ |
| ... | @@ -482,24 +493,24 @@ pub fn addCases(cases: *@import("tests.zig").ErrorTracesContext, os: std.Target. | ... | @@ -482,24 +493,24 @@ pub fn addCases(cases: *@import("tests.zig").ErrorTracesContext, os: std.Target. |
| 482 | \\ try foo(); | 493 | \\ try foo(); |
| 483 | \\ ^ | 494 | \\ ^ |
| 484 | , | 495 | , |
| 485 | .disable_trace_optimized = &.{ | 496 | }, |
| 486 | .{ .x86_64, .freebsd }, | 497 | .disable_trace_optimized = &.{ |
| 487 | .{ .x86_64, .netbsd }, | 498 | .{ .x86_64, .freebsd }, |
| 488 | .{ .x86_64, .linux }, | 499 | .{ .x86_64, .netbsd }, |
| 489 | .{ .x86, .linux }, | 500 | .{ .x86_64, .linux }, |
| 490 | .{ .aarch64, .freebsd }, | 501 | .{ .x86, .linux }, |
| 491 | .{ .aarch64, .netbsd }, | 502 | .{ .aarch64, .freebsd }, |
| 492 | .{ .aarch64, .linux }, | 503 | .{ .aarch64, .netbsd }, |
| 493 | .{ .loongarch64, .linux }, | 504 | .{ .aarch64, .linux }, |
| 494 | .{ .powerpc64le, .linux }, | 505 | .{ .loongarch64, .linux }, |
| 495 | .{ .riscv64, .linux }, | 506 | .{ .powerpc64le, .linux }, |
| 496 | .{ .s390x, .linux }, | 507 | .{ .riscv64, .linux }, |
| 497 | .{ .x86_64, .openbsd }, | 508 | .{ .s390x, .linux }, |
| 498 | .{ .x86_64, .windows }, | 509 | .{ .x86_64, .openbsd }, |
| 499 | .{ .x86, .windows }, | 510 | .{ .x86_64, .windows }, |
| 500 | .{ .x86_64, .macos }, | 511 | .{ .x86, .windows }, |
| 501 | .{ .aarch64, .macos }, | 512 | .{ .x86_64, .macos }, |
| 502 | }, | 513 | .{ .aarch64, .macos }, |
| 503 | }); | 514 | }, |
| 504 | } | 515 | }); |
| 505 | } | 516 | } |