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

test: Port integration_tests/arrays_31.f90, arrays_34.f90 and arrays_35.f90 from LFortran and improve LC to compile it #112

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Pranavchiku
Copy link

No description provided.

@Pranavchiku Pranavchiku marked this pull request as ready for review March 18, 2024 11:14
@Pranavchiku
Copy link
Author

Aah I forgot to update references, will do it.

@certik certik requested a review from czgdp1807 March 18, 2024 16:14
Comment on lines +36 to +39

[[test]]
filename = "../integration_tests/array_28.cpp"
asr = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[[test]]
filename = "../integration_tests/array_28.cpp"
asr = true
# TODO: Remove after integration_tests/array_28.cpp compiles with LC
[[test]]
filename = "../integration_tests/array_28.cpp"
asr = true

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference testing should be as limited as possible.

@@ -146,6 +146,14 @@ namespace LCompilers::CastingUtil {
} else {
dest = ASRUtils::extract_type(dest);
}
if (ASR::is_a<ASR::ArrayConstant_t>(*expr)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think casting should be done only on the basis of type. Using expression to decide casting operation seems more like a hard-coded approach.

Comment on lines +152 to +153
arr->m_args[i] = ASRUtils::expr_value(ASRUtils::EXPR(ASRUtils::make_Cast_t_value(al, loc, arr->m_args[i],
cast_kind, ASRUtils::expr_type(arr->m_args[i]))));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we are casting each array element to the type of that same array element. So, why is a casting being needed?

@czgdp1807
Copy link
Collaborator

Thanks for the reviews @Shaikh-Ubaid. I had similar questions but these changes felt harmless to me for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants