-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
enh: support visiting module in pass array by data #3741
Conversation
CI Failure: Test project /home/runner/work/lfortran/lfortran
Start 1: test_cwrapper
1/3 Test #1: test_cwrapper .................... Passed 0.00 sec
Start 2: test_stacktrace
2/3 Test #2: test_stacktrace .................. Passed 0.00 sec
Start 3: test_lfortran
3/3 Test #3: test_lfortran ....................***Exception: SegFault 0.11 sec
[doctest] doctest version is "2.4.8" I am not sure why it fails |
CI should pass now. |
This is weird, it works well for me now: % ctest
Test project /Users/pranavchiku/repos/lfortran
Start 1: test_cwrapper
1/3 Test #1: test_cwrapper .................... Passed 0.02 sec
Start 2: test_stacktrace
2/3 Test #2: test_stacktrace .................. Passed 0.01 sec
Start 3: test_lfortran
3/3 Test #3: test_lfortran .................... Passed 0.30 sec
100% tests passed, 0 tests failed out of 3
Total Test time (real) = 0.35 sec |
The failure is:
The relevant code: TEST_CASE("ASR -> LLVM 1") {
std::string source = R"(function f()
integer :: f
f = 5
end function)";
... |
It fails for me too, here is the stacktrace: (lf) lfortran/lfortran(gh3728) $ lldb ./src/lfortran/tests/test_lfortran
(lldb) target create "./src/lfortran/tests/test_lfortran"
Current executable set to '/Users/ondrej/repos/lfortran/lfortran/src/lfortran/tests/test_lfortran' (arm64).
(lldb) run
Process 14926 launched: '/Users/ondrej/repos/lfortran/lfortran/src/lfortran/tests/test_lfortran' (arm64)
[doctest] doctest version is "2.4.8"
[doctest] run with "--help" for options
Process 14926 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffff00c)
frame #0: 0x00000001018860d0 test_lfortran`bool LCompilers::ASR::is_a<LCompilers::ASR::Class_t, LCompilers::ASR::ttype_t>(x=0xfffffffffffff000) at asr.h:32:31
29 template <class T, class U>
30 inline bool is_a(const U &x)
31 {
-> 32 return T::class_type == x.type;
33 }
34
35 // Cast one level down
Target 0: (test_lfortran) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffff00c)
* frame #0: 0x00000001018860d0 test_lfortran`bool LCompilers::ASR::is_a<LCompilers::ASR::Class_t, LCompilers::ASR::ttype_t>(x=0xfffffffffffff000) at asr.h:32:31
frame #1: 0x00000001016a5fa0 test_lfortran`void LCompilers::RemoveArrayByDescriptorProceduresVisitor::visit_Unit<LCompilers::ASR::TranslationUnit_t>(this=0x000000016fdfde60, x=0x000000010782dcd8) at pass_array_by_data.cpp:649:54
frame #2: 0x000000010166e1d4 test_lfortran`LCompilers::RemoveArrayByDescriptorProceduresVisitor::visit_TranslationUnit(this=0x000000016fdfde60, x=0x000000010782dcd8) at pass_array_by_data.cpp:678:13
frame #3: 0x000000010166dca8 test_lfortran`LCompilers::pass_array_by_data(al=0x000000016fdfedb8, unit=0x000000010782dcd8, (null)=0x000000016fdfe988) at pass_array_by_data.cpp:713:7
frame #4: 0x0000000101cecd08 test_lfortran`LCompilers::PassManager::apply_passes(this=0x000000016fdfeae0, al=0x000000016fdfedb8, asr=0x000000010782dcd8, passes=size=30, pass_options=0x000000016fdfe988, diagnostics=0x000000016fdfed90) at pass_manager.h:167:17
frame #5: 0x0000000101cac0f8 test_lfortran`LCompilers::PassManager::apply_passes(this=0x000000016fdfeae0, al=0x000000016fdfedb8, asr=0x000000010782dcd8, pass_options=0x000000016fdfe988, diagnostics=0x000000016fdfed90) at pass_manager.h:311:21
frame #6: 0x0000000101caba40 test_lfortran`LCompilers::asr_to_llvm(asr=0x000000010782dcd8, diagnostics=0x000000016fdfed90, context=0x00006000000042e0, al=0x000000016fdfedb8, pass_manager=0x000000016fdfeae0, co=0x000000016fdfe970, run_fn="f", infile="") at asr_to_llvm.cpp:9792:18
frame #7: 0x000000010009f35c test_lfortran`DOCTEST_ANON_FUNC_18() at test_llvm.cpp:390:15
frame #8: 0x00000001007a2360 test_lfortran`doctest::Context::run(this=0x000000016fdff5e8) at doctest.h:6727:21
frame #9: 0x00000001007a4210 test_lfortran`main(argc=1, argv=0x000000016fdff778) at doctest.h:6805:71
frame #10: 0x00000001070990f4 dyld`start + 520 |
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 this is fine.
Aah, thanks for the fix! I’ll look into stdlib failure and get it fixed soon. |
The stdlib failure is:
|
MRE: module xx
interface gauss_legendre
procedure :: gauss_legendre_fp64
end interface gauss_legendre
contains
subroutine gauss_legendre_fp64(x)
real, intent(out) :: x(:)
end subroutine
end module
subroutine test_gauss_analytic()
use xx, only: gauss_legendre
block
real, dimension(5) :: x
call gauss_legendre(x)
end block
end subroutine |
I have CI changes ready, will open PR once this gets merged. |
Perfect, thanks! |
Fixes #3728.
With this we get
stdlib_stats_var
compiled to LLVM.