Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions contrib/juliac/juliac-buildscript.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import Base.Experimental.entrypoint
# for use as C main if needed
function _main(argc::Cint, argv::Ptr{Ptr{Cchar}})::Cint
args = ccall(:jl_set_ARGS, Any, (Cint, Ptr{Ptr{Cchar}}), argc, argv)::Vector{String}
setglobal!(Base, :PROGRAM_FILE, args[1])
popfirst!(args)
append!(Base.ARGS, args)
return Main.main(args)
end

Expand Down
1 change: 1 addition & 0 deletions test/trimming/hello.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ sum_areas(v::Vector{Shape}) = sum(area, v)

function @main(args::Vector{String})::Cint
println(Core.stdout, str())
println(Core.stdout, PROGRAM_FILE)
foreach(x->println(Core.stdout, x), args)

# test map/mapreduce; should work but relies on inlining and other optimizations
Expand Down