-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
System.out.println(2 * x) | ||
} | ||
|
||
/* unrooled code: |
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.
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.
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 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.
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.
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.
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 mean test the high-level code generated instead of the final bytecode.
b949c3a
to
2f5913e
Compare
a37fd8a
to
8d209a2
Compare
No description provided.