Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for behavior of conditional flow with global #57414

Merged
merged 3 commits into from
Feb 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8448,3 +8448,18 @@ myfun57023a(::Type{T}) where {T} = (x = @ccall mycfun()::Ptr{T}; x)
@test only(code_lowered(myfun57023a)).has_fcall
myfun57023b(::Type{T}) where {T} = (x = @cfunction myfun57023a Ptr{T} (Ref{T},); x)
@test only(code_lowered(myfun57023b)).has_fcall

# issue #57315
global flag57315=false
function f57315()
global flag57315
if flag57315
flag_2=true
else
if flag_2
return 2
end
end
return 1
end
@test_throws UndefVarError(:flag_2, :local) f57315()