summaryrefslogtreecommitdiff
path: root/test/junit
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Merge pull request #4868 from retronym/ticket/9542-comboJason Zaugg2016-02-101-1/+27
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | SI-9542 Fix regression in value classes (served two ways)
| * | | | | SI-9542 Unify different reprs. of module type refsJason Zaugg2016-02-011-1/+27
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new unit test shows failures in transitivity of subtyping and type equivalence, which boil down the the inconsistent handling of the semantically equivalent: ThisType(pre, ModuleClass) ModuleTypeRef(pre, ModuleClass) SingleType(pre, Module) This commit: - adds a case to `normalizePlus` to unwrap a `ThisType` to a `ModuleTypeRef` - Use `normalizePlus` more widely during subtype comparison - refactor `fourthTry` (part of `isSubType`) to remove code that becomes obviated by the use of `normalizePlus`. This fixes the regression in the extension methods phase which was triggered by https://github.com/scala/scala/pull/4749. We can also fix that regression by tweaking the extension methods phase itself to emit the `ThisType` representation of the owner of the value class, as before. I plan to demonstrate the two approaches to fixing the regression on separate branches, and the propose that the merged result of these two is useds.
* | | | | Merge remote-tracking branch 'origin/2.12.x' into ↵Jason Zaugg2016-02-046-6/+497
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | merge/2.11.x-to-2.12.x-20160203
| * | | | Merge pull request #4920 from lrytz/oldOptimizerTestsLukas Rytz2016-02-034-6/+379
| |\ \ \ \ | | | | | | | | | | | | restore / rewrite various tests
| | * | | | Re-write and Re-enable optimizer testsLukas Rytz2016-02-032-0/+356
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite tests for new optimizer - SI-6941 - SI-2171 - t3430 - t3252 - t4840 - t2171 - t3430 - t3252 - t6157 - t6547 - t8062 - t8306 - t8359 - t9123 - trait-force-info - private-inline test cases for bugs fixed in the new optimizer - SI-9160, the unnecessary boxing mentioned in the ticket is optimzied since push-pop elimination (#4858). - SI-8796 - SI-8524 - SI-7807 fix flags file for t3420 remove an empty flags file remove unnecessary partest filters explicit inliner warnings in test t7582 Restore the lisp test. Removing the flags file - our build runs with the (new) optimizer enabled anyway. The test spent the past few years as an optimizer test in pos/ see https://issues.scala-lang.org/browse/SI-4512. The attempt may fail, but why not give it a try. $ git lg -S"lisp" ... | * | | | f785785 - SI-4579 Yoke the power of lisp.scala as a stress for the optimizer. (3 years, 8 months ago) <Jason Zaugg> ... * | | | | | | 622cc99 - Revert the lisp test. (3 years, 10 months ago) <Paul Phillips> ... * | | | | | | 97f0324 - Revived the lisp test. (3 years, 10 months ago) <Paul Phillips> ... * | 1e0f7dc - Imprison the lisp test, no review. (4 years, 4 months ago) <Paul Phillips> ... * | 6b09630 - "Freed the lisp test." Tweaked partest defaults... (4 years, 6 months ago) <Paul Phillips> ... * | fec42c1 - Lisp test wins again, no review. (4 years, 8 months ago) <Paul Phillips> ... * | 1c2d44d - Restored the lisp.scala test. (4 years, 8 months ago) <Paul Phillips> ... * | 15ed892 - Temporarily sending lisp.scala to be interprete... (4 years, 8 months ago) <Paul Phillips> ...
| | * | | | show erroneous compiler flags in junit compiler testsLukas Rytz2016-02-031-2/+4
| | | | | |
| | * | | | Improve simplifyJumpsLukas Rytz2016-02-031-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve simplifyJumps to rewrite IFEQ L4 L5 GOTO L6 to IFNE L6 L5 This rewrite is only correct if L5 is not the target of any jump instruction (otherwise, removing the GOTO would change semantics). Previously we did not do the rewrite if there was any label between the conditional jump and the goto (like L5). Now we track which labels are jump targets.
| * | | | | Merge pull request #4737 from soc/SI-9315Lukas Rytz2016-02-031-0/+70
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-9315 Desugar string concat to java.lang.StringBuilder ...
| | * | | | | SI-9315 Desugar string concat to java.lang.StringBuilder ...Simon Ochsenreither2016-02-031-0/+70
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of scala.collection.mutable.StringBuilder to benefit from JVM optimizations. Unfortunately primitives are already boxed in erasure when they end up in this part of the backend.
| * | / / / Clarified and expanded which Builders were reusableRex Kerr2016-01-301-0/+48
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This additionally fixes both SI-8648 and SI-9564. Added documentation to Builder to clarify that in general Builders are NOT reusable. Altered implementation of GrowingBuilder to use Growable instance's clear (not valid for a reusable builder, but this one isn't reusable). Added a new marker trait ReusableBuilder that specifies that these builders should be reusable. This trait overrides the clear and result methods while leaving them abstract in order to supply appropriate scaladoc. Made all Array builders Reusable in all cases (by setting capacity to 0 if the original array is returned). (Fixed a poor implmentation of Array[Unit] builder along the way.) Documented which other builders were already reusable (maps, sets, Vector, LazyBuilder, StringBuilder, ListBuffer, etc.).
* | | | | Merge commit 'cc6fea6' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-041-1/+11
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | Conflicts: build.sbt scripts/jobs/integrate/bootstrap
| * | | | SI-9534 Use BoxedUnit in all cases for creating Array[Unit]Stefan Zeiger2016-01-271-1/+11
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Calling `wrap` or one of the higher-dimension Array factory methods on the `Manifest` for `Unit` led to an exception because it tried to use `void` as a primitive type. Unlike all other primitive Scala types, `Unit` needs to be boxed. The basic `newArray` method was not affected by this bug because it was already special-cased. The fix is to also special-case `arrayClass`.
* | | | Merge commit 'bf599bc' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-032-0/+78
|\| | | | |/ / |/| | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala src/compiler/scala/tools/nsc/transform/Constructors.scala src/compiler/scala/tools/nsc/typechecker/Contexts.scala src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery.layout.js
| * | SI-9605 Searching does not use binary search for ArrayRui Gonçalves2016-01-121-0/+48
| | | | | | | | | | | | Binary search should be used for every `IndexedSeqLike` instance and not only for `IndexedSeq`. According the Scaladoc, it is `IndexedSeqLike` that guarantees "constant-time or near constant-time element access and length computation".
| * | SI-9581 Fix overflow on Vector take and drop methodsRui Gonçalves2015-12-061-0/+30
| | | | | | | | | | | | | | | | | | Fixes the index/length comparison in `Vector#take` and `Vector#drop` so that they handle all possible integer values. Given the collection's invariants `startIndex >= endIndex` and `0 >= startIndex, endIndex`, it is sufficient to change the arithmetic in the comparison as done in this commit to avoid overflows. As cases when `n <= 0` are handled beforehand, `endIndex - n` cannot overflow, contrary to `startIndex + n`. If without the danger of overflows the condition yields true, on the other hand, `startIndex + n` cannot overflow as it is smaller than `endIndex` (as the previous formulation of the condition shows).
* | | SI-9398 Treat case classes as one-element ADTs for analysisJason Zaugg2016-01-291-1/+1
| |/ |/| | | | | | | | | | | | | Currently, exhaustivity analysis only runs for scrutinees with a sealed type. This commit treats any case class as a one-element, sealed type to enable additional analysis, such as in the new test case.
* | Rename junit tests to end in *Test to make them run in ANTLukas Rytz2016-01-254-7/+5
| | | | | | | | | | | | Our ANT script only runs junit tests that match *Test.class. https://github.com/scala/scala/blob/1081e718f8f8e174dbf615e42b157e187d3d3886/build.xml#L1467
* | Rewrite test: no local for underscoreLukas Rytz2016-01-251-0/+19
| |
* | Rewrite test: no null in patmatLukas Rytz2016-01-251-0/+13
| |
* | Rewrite test: no type test on primitives in patmatLukas Rytz2016-01-251-0/+19
| |
* | Rewrite test for SI-7006Lukas Rytz2016-01-251-0/+24
| |
* | Rewrite test for inlining higher-order functionsLukas Rytz2016-01-251-0/+20
| |
* | Rewrite test for inlining from sealed classLukas Rytz2016-01-252-1/+29
| |
* | Rewrite copy propagation testLukas Rytz2016-01-251-6/+73
| |
* | Rewrite test for SI-5313Lukas Rytz2016-01-251-1/+92
| |
* | Rewrite test for SI-6955Lukas Rytz2016-01-251-0/+28
| |
* | Rewrite test for SI-6956Lukas Rytz2016-01-251-0/+58
| |
* | Merge remote-tracking branch 'upstream/2.12.x' into opt/elimBoxesLukas Rytz2016-01-246-19/+201
|\ \
| * | Fix problems with a locale-dependent decimal mark in StringContextTestMichał Pociecha2016-01-131-16/+36
| | | | | | | | | | | | | | | | | | | | | | | | Depending on the current locale one can get 3,400000e+00 instead of 3.400000e+00 so the expected result should take this into account. It's a similar change to one I made some time ago in 2.11.x: https://github.com/scala/scala/pull/4204
| * | Make StringContextTest pass on WindowsLinas Medziunas2016-01-131-3/+2
| | | | | | | | | | | | | | | | | | One assertion in StringContextTest."f interpolator baseline"() was relying on platform specific newline encoding, making it fail when run on Windows.
| * | Merge pull request #4875 from slothspot/ticket/9454Lukas Rytz2015-12-181-0/+1
| |\ \ | | | | | | | | [SI-9454] Add isAlive method into sys.process.Process trait
| | * | [SI-9454] Add isAlive method into sys.process.Process traitDmitry Melnichenko2015-12-111-0/+1
| | | |
| * | | SI-9583: Update SystemProperties.empty to return a mutable.Map to fix buildersShane Delmore2015-12-101-0/+27
| |/ /
| * | Merge commit '8eb1d4c' into merge-2.11-to-2.12-nov-24Lukas Rytz2015-11-242-0/+99
| |\|
| | * Merge pull request #4809 from wpopielarski/delambdafy-multiple-outputsJason Zaugg2015-11-131-0/+73
| | |\ | | | | | | | | Multi output problem with delambdafied compilation
| | | * Test addedwpopielarski2015-11-061-0/+73
| | | |
| | * | SI-9497 Fix SetLike#clear() default implementationRui Gonçalves2015-10-211-0/+26
| | |/ | | | | | | | | | When dealing with mutable collections, it is not safe to assume iterators will remain consistent when the collection is modified mid-traversal. The bug reported in SI-9497 is very similar to SI-7269, "ConcurrentModificationException when filtering converted Java HashMap". Then, only the `retain` method was fixed. This commit fixes `clear`, which had the same problem.
| * | SI-9363 - Add empty serializabletriggerNZ2015-11-241-0/+2
| | |
| * | Fix for SI-9363triggerNZ2015-11-241-0/+34
| | |
* | | Jump optimizations may enable more push-pop eliminationLukas Rytz2016-01-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | Jump optimization replaces an unnecessary conditional jump, e.g. `IFNULL l; l: ...` by `POP`, which enables further push-pop elimination. Also introduces a `-YoptTrace` flag that traces the progress of the bytecode as it goes through local optimizations.
* | | SI-8601 Don't treat newarray as dead codeLukas Rytz2016-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we lose the side effect of a `NegativeArraySizeException`. A test for this case already exists (run/t8601b.scala), but it currently enforces `-optimize -Ybackend:GenASM`, so it didn't trigger on the new backend. However, PR #4814 was merged into 2.12.x and moved that test over to the new backend and optimizer. After merging the 2.12.x into the current optimizer branch (push-pop elimination), the test started failing. Also disable the optimizer for `jvm/bytecode-test-example`: it counts the number of null checks in a method, the optimizer (rightly) eliminates one of the two.
* | | Harden methods to recognize method invocations to optimizeLukas Rytz2016-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous methods to identify method invocations that can be optimized, such as `isPredefAutoBox`, were String-based. Now we obtain class and method signatures from symbols through the BTypes infrastructure. We also piggy-back on specialization's type transformer to create all specialized subclasses of Tuple1/Tuple2. We'll do the same in the future for FunctionN, but the current JFunctionN are written in Java and specialized artisanally.
* | | Run DCE before the closure optimizer (fixes a crash)Lukas Rytz2016-01-201-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before identifying function callsites within the same method as a closure allocation, run DCE. The ProdCons analysis used to identify these function calls may crash if there is unreachable code, as observed in the community build with scala-js. The crash was rare because inlining, which is performed before closure optimizations, already runs DCE. However, inlining may render more code unreachable (e.g. when inlining a method that throws). Also make sure that DCE is always performed on the callee before inlining: move the DCE invocation into the inlineCallsite method, which is also invoked by the closure optimizer.
* | | Apply local optimization based on nullness informationLukas Rytz2015-12-152-13/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize IFNULL branches to GOTO when (non-)nullness of the tested value is known statically. This enables unreachable code to be removed, which in turn enables boxes to be eliminated. Changed a test flag from `-Ynooptimise` to `-Yopt:l:classpath` - I still have to do this systematically, this will follow later.
* | | Eliminate unnecessary castsLukas Rytz2015-12-153-10/+41
| | | | | | | | | | | | | | | | | | Eliminate casts that are statically known to succeed. This enables boxes to be eliminated and simplifies the implementation of closure allocation elimination.
* | | Eliminate non-escaping boxes, tuples and refsLukas Rytz2015-12-152-55/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate boxes, tuples and refs that are created and used within a single method without escaping. For details on the implementation see the doc comment in class BoxUnbox. This commit also cleans up the logic of inter-dependent method-level optimizations that run until reaching a fixpoint.
* | | Make some testing tools from InlinerTest available to other testsLukas Rytz2015-12-133-20/+17
| | |
* | | Rename test MethodLevelOpts -> MethodLevelOptsTestLukas Rytz2015-12-131-4/+4
| | |
* | | Support specialized functions in closure optimizerLukas Rytz2015-11-132-0/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/scala/scala-dev/issues/52. An IndyLambda may create a specialized function type, where the SAM is the corresponding specialized variant of apply. If this closure is invoked through the generic apply method, the closure optimizer would previously not re-write the invocation to the $anonfun method. This is now done, including the necessary box / unbox operations.
* | | Fix specialized function class names in closure optimizerLukas Rytz2015-11-101-0/+17
| | |