aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-08-18 13:25:13 -0700
committerGitHub <noreply@github.com>2025-08-18 13:25:13 -0700
commit001ec07772f35ffee031429a558506b89d02cdca (patch)
tree2c626a0670ba522cc201e5af8d922e2c395b8ed5 /test
parentc1483eb05c221b4f0c0c357bf75b828f722fa44d (diff)
parent52178d14b080d0bbf5e1fe8ed25ce1c26ea18566 (diff)
downloadzig-001ec07772f35ffee031429a558506b89d02cdca.tar.gz
zig-001ec07772f35ffee031429a558506b89d02cdca.zip
Merge pull request #24249 from antlilja/dwarf-extern-arg
Fix compiler crash when passing a comptime extern function arg to a function
Diffstat (limited to 'test')
-rw-r--r--test/behavior/extern.zig13
-rw-r--r--test/incremental/change_exports2
2 files changed, 14 insertions, 1 deletions
diff --git a/test/behavior/extern.zig b/test/behavior/extern.zig
index 9efb1c2137..7541a1957d 100644
--- a/test/behavior/extern.zig
+++ b/test/behavior/extern.zig
@@ -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 {}
diff --git a/test/incremental/change_exports b/test/incremental/change_exports
index e492930031..01605bdeeb 100644
--- a/test/incremental/change_exports
+++ b/test/incremental/change_exports
@@ -1,4 +1,4 @@
-#target=x86_64-linux-selfhosted
+//#target=x86_64-linux-selfhosted
#target=x86_64-linux-cbe
#target=x86_64-windows-cbe