diff --git a/test/core.jl b/test/core.jl index ee4605ff60704..b3dd90d9bba49 100644 --- a/test/core.jl +++ b/test/core.jl @@ -4469,3 +4469,10 @@ let k(x) = (k = x; k) @test k(1) == 1 end + +# PR #18054: compilation of cfunction leaves IRBuilder in bad state, +# causing heap-use-after-free when compiling f18054 +function f18054() + return Cint(0) +end +cfunction(f18054, Cint, ())