Commit Graph

711 Commits

Author SHA1 Message Date
Mikhael Bogdanov d806320383 Rename tmpDirForReusableLibrary -> tmpDirForReusableFolder 2019-04-10 20:03:09 +02:00
Mikhael Bogdanov 8287e448d1 Support parallel execution of IDEA tests 2019-04-10 20:03:08 +02:00
victor.petukhov 3ba48f219c Remove debug code in the test for CheckerTestUtil class 2019-04-10 17:10:56 +03:00
Ilmir Usmanov 00e952ab15 Introduce CHECK_TAIL_CALL_OPTIMIZATION directive
This directive generates TailCallOptimizationChecker in package helpers.
The check for tail call optimization is based on coroutine stack traces
bug (feature?): when tail call optimization hits, the continuation
object is not generated. Thus, there is no debug metadata for this
suspend function. Consequently, the coroutines stack trace does not
contain stack trace element for that function.
This check is performed by TailCallOptimizationChecker.

Since this is runtime check, unlike bytecode tests, it does not require
test data adjustments on each codegen or inliner change.

Since the check is based on debug metadata, which is JVM specific, there
is not support for other backends yet.
2019-04-09 18:01:21 +03:00
Mikhail Glukhikh 40441a18cc FIR2IR tests: do not try to dump & check external dependencies
(because both wrapped descriptors and FIR-based package descriptors
have no member scopes and aren't able to find class across module deps)
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh 485035952a IR text tests: fix regex detection (like DUMP_EXTERNAL_CLASS)
Before this commit, DUMP_EXTERNAL_CLASS etc. didn't work on Windows
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh 02bdc826d5 IR text tests: throw an error when test fails to build an external dump 2019-04-09 15:36:16 +03:00
Nikolay Krasko bfda9cc57b Fix inspection Integer.toString() -> int.toString() reports 2019-04-09 11:47:30 +03:00
pyos 3fdcf8376f Add IR equivalent of the WriteFlags test 2019-04-09 08:11:29 +02:00
Mikhail Glukhikh 881073b1c9 Add basic FIR -> IR converter with a set of text tests
Tests duplicate IrTextTestCaseGenerated
#KT-24065 Fixed
2019-04-05 16:18:58 +03:00
Alexander Udalov b32241c967 JVM IR: build all needed stdlib symbols in JvmSymbols manually
This removes the mandatory dependency of all JVM IR tests on
kotlin-stdlib (ConfigurationKind.ALL in all IR test cases) and speeds up
tests which don't need kotiln-stdlib by about 20%. Another advantage of
this method is that all required dependencies are listed in one file,
are easy to grasp, and changes to the related code generation can be
done independently of the corresponding changes in the actual library,
which may help in bootstrapping the compiler
2019-03-29 12:07:11 +01:00
Alexander Udalov cb7727d51a Add explicit WITH_RUNTIME to boxAgainstJava tests which need stdlib 2019-03-28 14:26:10 +01:00
Mikhael Bogdanov 9c21c71c63 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:51:28 +01:00
Mikhael Bogdanov f34a2923b5 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:17:38 +01:00
Mikhael Bogdanov 0c60ff0e80 Revert "Revert "Allow tests to be run in parallel.""
This reverts commit bdad3cac
2019-03-28 13:17:37 +01:00
Ilmir Usmanov 95f4115a10 Replace global mutable object with global variable 2019-03-27 21:40:13 +03:00
Ilmir Usmanov 1c2b8e6fad Fix wrong state-machine generation if inner object is retransformed
during inlining.
 #KT-29492 Fixed
2019-03-27 17:44:35 +03:00
Sergey Rostov 6bf82c1053 Gradle, Kotlin/JS: fix failing tests on Windows 2019-03-27 11:23:53 +03:00
Zalim Bashorov bdad3cace9 Revert "Allow tests to be run in parallel."
This reverts commit 21d81f35
2019-03-26 15:22:40 +03:00
Steven Schäfer 21d81f353c Allow tests to be run in parallel. 2019-03-25 19:50:37 +01:00
Alexander Udalov 87c6b723f0 Add JvmBuiltIns.Kind instead of boolean flags in constructor 2019-03-22 14:59:03 +01:00
Alexander Udalov ed86757817 Rework how built-in types are loaded in compiler for JVM
In TopDownAnalyzerFacadeForJVM, we now always use the "load built-ins
from module dependencies" behavior that was previously only enabled with
the dedicated CLI argument -Xload-builtins-from-dependencies. However,
sometimes we compile code without kotlin-stdlib in the classpath, and we
don't want everything to crash because some standard type like
kotlin.Unit hasn't been found.

To mitigate this, we add another module at the end of the dependencies
list, namely a "fallback built-ins" module. This module loads all
built-in declarations from the compiler's class loader, as was done by
default previously. This prevents the compiler from crashing if any
built-in declaration is not found, but compiling the code against
built-ins found in the compiler is still discouraged, so we report an
error if anything is resolved to a declaration from this module, via a
new checker MissingBuiltInDeclarationChecker.

Also introduce a new CLI argument -Xsuppress-missing-builtins-error
specifically to suppress this error and to allow compiling code against
compiler's own built-ins.

 #KT-19227 Fixed
 #KT-28198 Fixed
2019-03-22 14:59:03 +01:00
Alexander Udalov 05700b8c43 Use JvmResolveUtil.createContainer in AbstractDescriptorRendererTest 2019-03-22 14:59:03 +01:00
Simon Ogorodnik 5aa783a961 FIR: Fix visitors/transformers and testData 2019-03-22 16:25:19 +03:00
Georgy Bronnikov fae003866b Use CLI compiler arguments directly in PhaseConfig creation 2019-03-21 23:32:25 +03:00
Alexander Udalov 0fb444a5d1 Move createPhaseConfig to module cli
To use things like MessageCollector to report errors/warnings related to
incorrect phase configuration flags
2019-03-21 23:32:25 +03:00
Alexander Udalov 2995be8bd2 Move usages of createPhaseConfig up to cli & test modules 2019-03-21 23:32:25 +03:00
Ilya Chernikov c56382a62b Move common idea and compiler parts of the scripting plugin to the new jar 2019-03-21 12:02:29 +01:00
Dmitry Petrov e49eae528c IR: don't use descriptors in rendering (work in progress)
There's some descriptor-based code remaining. Need some more work on IR.
2019-03-21 11:23:51 +03:00
Mikhail Glukhikh 16f9eecb29 Fix "/ by zero" in FirResolveBench & switch progress OFF in smoke tests 2019-03-18 17:12:02 +03:00
Mikhail Glukhikh 741bdccca5 Enhance progress logging in FIR total resolve tests 2019-03-18 14:49:11 +03:00
Ilmir Usmanov c68413b953 Do not generate StateMachineChecker if CHECK_STATE_MACHINE directive is
not present.
Otherwise, since it uses suspend functions, it breaks IR tests.
2019-03-18 14:04:03 +03:00
Ilmir Usmanov df52c5217d Add facility to check number of suspensions in coroutine tests 2019-03-18 14:04:01 +03:00
Alexander Udalov 0c8e58936c Remove DeepCopyIrTree and most "Creates unbound symbol" deprecated members 2019-03-15 19:05:19 +01:00
Simon Ogorodnik e056882aa6 Add DiagnosticsTest testData based smoke test for FIR #KT-29962 Fixed
Yet seven of these tests fail with an exception in RawFirBuilder
2019-03-15 18:31:55 +03:00
Alexander Udalov 76aff56b04 Remove unneded parameter of ResolverForProjectImpl 2019-03-11 18:31:59 +01:00
Alexander Udalov c7c377e1b1 Use JvmTarget.DEFAULT instead of JVM_1_6 where applicable 2019-03-07 11:42:31 +01:00
Nikolay Krasko ec0084ef61 Minor: remove outdated ant mentioning 2019-03-06 18:16:30 +03:00
Nikolay Krasko 0e990ae01b Update inserting algorithm to preserve order for tags with the same offset 2019-03-06 18:16:29 +03:00
Alexander Udalov 69eae035f6 JVM IR: do not add kotlin-reflect in tests unconditionally 2019-03-05 17:58:09 +01:00
Alexander Udalov b73a927133 Remove KotlinTestUtils.replaceHash
Both package parts and SAM wrappers have no hashes in their names for a
long time already
2019-03-05 16:28:53 +01:00
Alexander Udalov 74b14f14bd Minor, refactor parseLanguageVersionSettings
Get rid of code duplication, use a more type-safe approach to
enumerating analysis flags
2019-03-05 16:28:53 +01:00
Alexander Udalov aaa2bad719 Do not use IR_EXTERNAL_JAVA_DECLARATION_STUB in DeclarationStubGenerator
This code is common across backends and it should not depend on
JVM-specific behavior. Introduce GeneratorExtensions to reverse the
dependency here
2019-03-05 16:28:33 +01:00
Alexander Udalov f29012a78f Remove unreachable code in psi2ir tests, delete unused tests 2019-03-05 16:28:33 +01:00
Mikhael Bogdanov 6d9c49e55e Add IrCompileKotlinAgainstKotlinTest tests 2019-03-04 13:59:58 +01:00
Shagen Ogandzhanian 7162dd9807 Prepare JsTestChecker (but not introduce so far) for J2V8 adoption 2019-03-01 15:29:35 +01:00
Dmitry Savvinov 50d1c013fc Force-resolve body in contract computation under lock
Even though acquire/release pattern guarantees memory visibility across
threads, it doesn't prevents concurrent access to critical section (i.e.
to force-resolve of the corresponding body).

This can lead to multiple resolution passes over one and the same PSI in
IDE, which, in turn, leads to 'rewrite at slice'-exceptions. See
KT-30030 for case description and details.

^KT-30030 Fixed
2019-02-25 11:10:16 +03:00
Alexander Udalov 3d1858a8c5 Refactor and rename CodegenUtil.getDeclarationsToGenerate
Move logic regarding expect classes to the only relevant call site at
PackageCodegenImpl, and return the list of members to remove code
duplication at remaining call sites
2019-02-19 16:37:46 +01:00
Simon Ogorodnik 5afb0a6f4a FIR rename: FirType -> FirTypeRef and related 2019-02-19 09:54:24 +03:00
Ilya Gorbunov 8ed2facc8c Remove integration test involving kotlin-stdlib-jre7/8 2019-02-18 18:45:20 +03:00