-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Optimizer tests (disabled for now) #24948
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
Open
SolalPirelli
wants to merge
14
commits into
scala:main
Choose a base branch
from
dotty-staging:solal/optimizer-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
dfa6041
Let IntelliJ delete an icon
SolalPirelli cfebb46
Minor cleanup, remove obsolete TODO
SolalPirelli b272191
Disable existing tests properly
SolalPirelli e5e95ac
Add new e2e tests, failing
SolalPirelli ae4bd8e
More
SolalPirelli 47283a5
more
SolalPirelli a0b7efb
end?
SolalPirelli 37a74f4
And the ignore
SolalPirelli 560d9b1
Apply suggestion from @SolalPirelli
SolalPirelli 3faffae
PR feedback
SolalPirelli 417699f
Port more stuff
SolalPirelli 1504859
Not needed
SolalPirelli f866bb3
More
SolalPirelli fa69811
Revert "Let IntelliJ delete an icon"
SolalPirelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 5 additions & 7 deletions
12
compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,7 @@ package dotty.tools.backend.jvm | |
|
|
||
| import scala.language.unsafeNulls | ||
|
|
||
| import org.junit.Assert._ | ||
| import org.junit.Test | ||
| import org.junit.{Test, Ignore} | ||
|
|
||
| import scala.tools.asm.Opcodes._ | ||
|
|
||
|
|
@@ -75,46 +74,13 @@ class InlineBytecodeTests extends DottyBytecodeTest { | |
| } | ||
| } | ||
|
|
||
| /** Disabled since locally comes from Predef now | ||
SolalPirelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @Test | ||
| def inlineLocally = { | ||
| val source = | ||
| """ | ||
| |class Foo { | ||
| | def meth1: Unit = locally { | ||
| | val a = 5 | ||
| | a | ||
| | } | ||
| | | ||
| | def meth2: Unit = { | ||
| | val a = 5 | ||
| | a | ||
| | } | ||
| |} | ||
| """.stripMargin | ||
|
|
||
| checkBCode(source) { dir => | ||
| val clsIn = dir.lookupName("Foo.class", directory = false).input | ||
| val clsNode = loadClassNode(clsIn) | ||
| val meth1 = getMethod(clsNode, "meth1") | ||
| val meth2 = getMethod(clsNode, "meth2") | ||
|
|
||
| val instructions1 = instructionsFromMethod(meth1) | ||
| val instructions2 = instructionsFromMethod(meth2) | ||
|
|
||
| assert(instructions1 == instructions2, | ||
| "`locally` was not properly inlined in `meth1`\n" + | ||
| diffInstructions(instructions1, instructions2)) | ||
| } | ||
| } | ||
| */ | ||
| /* | ||
| @Ignore("Intended to document how `.nn` is compiled, but out of date, and not useful until we have an optimizer that can eliminate dead code") | ||
| @Test def inlineNn = { | ||
| val source = | ||
| s""" | ||
| |class Foo { | ||
| | def meth1(x: Int | Null): Int = x.nn | ||
| | def meth2(x: Int | Null): Int = x.getClass; x | ||
| | def meth2(x: Int | Null): Int = { x.getClass; x.asInstanceOf[Int] } | ||
| |} | ||
| """.stripMargin | ||
|
|
||
|
|
@@ -132,7 +98,7 @@ class InlineBytecodeTests extends DottyBytecodeTest { | |
| diffInstructions(instructions1, instructions2)) | ||
| } | ||
| } | ||
| */ | ||
|
|
||
| @Test def i4947 = { | ||
| val source = """class Foo { | ||
| | transparent inline def track[T](inline f: T): T = { | ||
|
|
@@ -369,7 +335,7 @@ class InlineBytecodeTests extends DottyBytecodeTest { | |
| } | ||
| } | ||
|
|
||
| // Testing that a is not boxed | ||
| // Testing that a is not boxed | ||
| @Test def i4522 = { | ||
| val source = """class Foo { | ||
| | def test: Int = { | ||
|
|
@@ -478,7 +444,6 @@ class InlineBytecodeTests extends DottyBytecodeTest { | |
| } | ||
| } | ||
|
|
||
|
|
||
| @Test def i9246 = { | ||
| val source = """class Foo: | ||
| | inline def check(v:Double): Unit = if(v==0) throw new Exception() | ||
|
|
@@ -520,7 +485,6 @@ class InlineBytecodeTests extends DottyBytecodeTest { | |
| } | ||
| } | ||
|
|
||
|
|
||
| @Test def i9466 = { | ||
| val source = """class Test: | ||
| | inline def i(inline f: Int => Boolean): String = | ||
|
|
@@ -651,7 +615,7 @@ class InlineBytecodeTests extends DottyBytecodeTest { | |
|
|
||
| val fun = getMethod(clsNode, "test") | ||
| val instructions = instructionsFromMethod(fun) | ||
| val expected = // TODO room for constant folding | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked, this TODO was done (the code below was modified but this todo was kept) |
||
| val expected = | ||
| List( | ||
| IntOp(BIPUSH, 6), | ||
| Op(IRETURN), | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
re: the icon.png deletion above, every time I open the project IntelliJ wants to do this, so...
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.
@hamzaremmal I don't really get why it was added in the first place in #21188 it's just for local users to make distinguishment of this repo easier, right ?
If the intelij suggests deletion then maybe we should check if that method is outdated or just add it to .gitignore (it's already commited so it's fine)
Uh oh!
There was an error while loading. Please reload this page.
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.
Yea, I use IntelliJ and it renders it in the projects list. scala 2 also has the same btw
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.
OK, in that case I'll revert this and figure out why that's happening on my machine later, thanks