authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-06 16:33:34-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-07 00:48:32-07:00
logd721d9af69220c059a7be825d295a0b53081c4a0
tree4a158efc62043d5cf1b197211b711ccf2ffeaf53
parent2a651eab454151b590a9891b5c8e18c9ff8ea4aa

update coff_dwarf standalone test to new API

and make it still test compilation on non-Windows

2 files changed, 10 insertions(+), 9 deletions(-)

test/standalone/coff_dwarf/build.zig+4-3
......@@ -7,9 +7,10 @@ pub fn build(b: *std.Build) void {
77 b.default_step = test_step;
88
99 const optimize: std.builtin.OptimizeMode = .Debug;
10 const target = b.standardTargetOptions(.{});
11
12 if (builtin.os.tag != .windows) return;
10 const target = if (builtin.os.tag == .windows)
11 b.standardTargetOptions(.{})
12 else
13 b.resolveTargetQuery(.{ .os_tag = .windows });
1314
1415 if (builtin.cpu.arch == .aarch64) {
1516 // https://github.com/ziglang/zig/issues/18427
test/standalone/coff_dwarf/main.zig+6-6
......@@ -17,11 +17,11 @@ pub fn main() !void {
1717
1818 const module = try debug_info.getModuleForAddress(add_addr);
1919 const symbol = try module.getSymbolAtAddress(allocator, add_addr);
20 defer symbol.deinit(allocator);
20 defer if (symbol.source_location) |sl| allocator.free(sl.file_name);
2121
22 try testing.expectEqualStrings("add", symbol.symbol_name);
23 try testing.expect(symbol.line_info != null);
24 try testing.expectEqualStrings("shared_lib.c", std.fs.path.basename(symbol.line_info.?.file_name));
25 try testing.expectEqual(@as(u64, 3), symbol.line_info.?.line);
26 try testing.expectEqual(@as(u64, 0), symbol.line_info.?.column);
22 try testing.expectEqualStrings("add", symbol.name);
23 try testing.expect(symbol.source_location != null);
24 try testing.expectEqualStrings("shared_lib.c", std.fs.path.basename(symbol.source_location.?.file_name));
25 try testing.expectEqual(@as(u64, 3), symbol.source_location.?.line);
26 try testing.expectEqual(@as(u64, 0), symbol.source_location.?.column);
2727}