-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Fix ASR verify pass error while using Interactive #4086
Conversation
CHECK(r.ok); | ||
CHECK(r.result.type == FortranEvaluator::EvalResult::integer4); | ||
CHECK(r.result.i32 == 1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are adding this test, maybe try to use/test a variety of types like integer8, real4, real8, logical (along with integer4)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just makes the test more robust and makes it easier to catch bugs earlier than later in development.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main purpose of the tests is to detect function dependencies related bugs. In all the tests I have written, there are 2 functions one dependent on the other.
I have added another test that deals with real values. Once we merge #4006 we will have another test dealing with logical values. I guess that should be sufficient tests.
I can write more tests if you think this is insufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main purpose of the tests is to detect function dependencies related bugs. In all the tests I have written, there are 2 functions one dependent on the other.
It makes sense. It is fine for now.
Please mark as "Ready for review" when ready. |
There seems a failure on windows. We need the CI to be green to merge this. PS: For now, I have rerun it. Let's see if it passes. |
The failure on windows seems real. We need to fix it. |
For reference: $ ./src/lfortran/tests/Release/test_lfortran.exe
[doctest] doctest version is "2.4.8"
[doctest] run with "--help" for options
0 0 0 0 0 0 0 0 0 0
JIT session error: Failed to materialize symbols: { (Main, { sub }) }
JIT session error: Failed to materialize symbols: { (Main, { __real@80000000 }) }
===============================================================================
C:\Users\vipul\Documents\Workspace\lfortran\src\lfortran\tests\test_llvm.cpp(1175):
TEST CASE: FortranEvaluator asr verify 3
C:\Users\vipul\Documents\Workspace\lfortran\src\lfortran\tests\test_llvm.cpp(1175): ERROR: test case THREW exception: lookup() failed to find the symbol '__lfortran_evaluate_4', error: Failed to materialize symbols: { (Main, { __lfortran_evaluate_4 }) }
===============================================================================
[doctest] test cases: 87 | 86 passed | 1 failed | 0 skipped
[doctest] assertions: 607 | 607 passed | 0 failed |
[doctest] Status: FAILURE! |
Yes, Windows always gave me a lot of issues with regards to interactivity. |
101f7b3
to
7a7ef72
Compare
7a7ef72
to
dff0d3c
Compare
Co-authored-by: Shaikh Ubaid <shaikhubaid769@gmail.com>
dff0d3c
to
4a42d47
Compare
I have managed to fix the errors on Windows by modifying Please have a look at it and let me know if it requires any more changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me! Thanks!
@Vipul-Cariappa updated the KaleidoscopeJIT referring the LLVM 16 documentation. The changes look good to me. These affect only the JIT mode and the regular mode should be fine.
Just to be safe, @certik can you have a quick glance through it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that looks good to me!
Does interactive mode still work with older LLVM versions?
Yes. Interactive mode works in all the LLVM versions we test with. |
I merged it, but unfortunately CI fails after merging: https://github.com/lfortran/lfortran/actions/runs/9410908077/job/25923326818
@Vipul-Cariappa can you please investigate why it might be failing? If you can fix it quickly, then let's do it. Otherwise I'll have to revert this, not to block other work with the CI failure. |
Looking at the failing test: program intrinsics_74
implicit none
real :: x(1, 2)
x = 0
call srand(0)
call random_number(x(1, 2))
print *, x
if (abs(x(1, 1) - 0.0) > 1e-5) error stop
if (abs(x(1, 2) - 0.0) < 1e-5) error stop
end program I am not sure if it is related to this PR or not. CC @Shaikh-Ubaid |
Ok, here is the failure:
So that's a bad test, unrelated to this PR. |
Good to know, my changes did not cause the problem. |
I rerun the CI, it works. So this PR is fine. The actual bug is #4167, unrelated to this PR. |
Reference lcompilers/lpython#2706
This PR is required by #4006