Skip to content

Add tests example of a partially unrolled loop #4736

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

Merged
merged 5 commits into from
Jul 16, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

System.out.println(2 * x)
}

/* unrooled code:
Copy link
Member

Choose a reason for hiding this comment

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

You can add a test to https://github.com/lampepfl/dotty/blob/master/compiler/test/dotty/tools/backend/jvm/InlineBytecodeTests.scala to check that the code produced by the compiler actually is what you think it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't thinks InlineBytecodeTests.scala supports separate compilation. Not sure how much work it would be to make it support it. It is probably better to just test the code directly.

Copy link
Member

Choose a reason for hiding this comment

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

What do you mean by "test the code directly"? You're doing code generation here, if you don't test that the code you generate looks like the way you think it should look like, I can guarantee you that you will have hard-to-find bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean test the high-level code generated instead of the final bytecode.

@nicolasstucki nicolasstucki force-pushed the quoted-unrolled-loop branch from b949c3a to 2f5913e Compare June 29, 2018 08:26
@biboudis biboudis merged commit d1a184c into scala:master Jul 16, 2018
@biboudis biboudis deleted the quoted-unrolled-loop branch July 16, 2018 11:36
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