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

Allow initialization of char ptr array #645

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

kant2002
Copy link
Collaborator

@kant2002 kant2002 commented Sep 6, 2024

No description provided.

@ForNeVeR ForNeVeR self-requested a review September 6, 2024 11:36
@ForNeVeR ForNeVeR self-assigned this Sep 6, 2024
public Task ArrayCharComparison() => DoTest(@"
int main() {
const char a[1] = { 'A' };
if (a[0] != 'D') {
Copy link

Choose a reason for hiding this comment

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

Why is there a check for 'D' despite the array being initialized with 'A'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I test what’s generated. I need comparison with any char literal. Does not matter what.

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah. This doesn't matter. We don't even run this code. It's for the purpose of dumping the codegen results. So, more variety (within some measure of course) — more chances the tests will catch unexpected codegen changes. This is good.

Copy link
Owner

@ForNeVeR ForNeVeR left a comment

Choose a reason for hiding this comment

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

Thanks!

@ForNeVeR ForNeVeR merged commit eec3a19 into ForNeVeR:main Sep 10, 2024
3 checks passed
@kant2002 kant2002 deleted the kant/init-charptr-arr branch September 10, 2024 07:18
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