Merge pull request #24249 from antlilja/dwarf-extern-arg

Fix compiler crash when passing a comptime extern function arg to a function
This commit is contained in:
Andrew Kelley
2025-08-18 13:25:13 -07:00
committed by GitHub
8 changed files with 243 additions and 65 deletions

View File

@@ -56,3 +56,16 @@ test "coerce extern function types" {
_ = @as(fn () callconv(.c) ?*u32, c_extern_function);
}
fn a_function(func: fn () callconv(.c) void) void {
_ = func;
}
test "pass extern function to function" {
a_function(struct {
extern fn an_extern_function() void;
}.an_extern_function);
a_function(@extern(*const fn () callconv(.c) void, .{ .name = "an_extern_function" }).*);
}
export fn an_extern_function() void {}

View File

@@ -1,4 +1,4 @@
#target=x86_64-linux-selfhosted
//#target=x86_64-linux-selfhosted
#target=x86_64-linux-cbe
#target=x86_64-windows-cbe