In generated __entry function, there is the simple call to main function:
define void @__entry() #16 {
entry:
call void @main()
br label %return
return: ; preds = %entry
call void @llvm.evm.stop()
unreachable
}
While this is not a problem in optimized code (main function is always inlined in __entry), in non-optimized code we will run into an issue where PUSHDEPLOYADDRESS is not in the __entry function.
This should be fixed by removing main function and emit everything from that function to __entry.