Commit Graph

456 Commits

Author SHA1 Message Date
Ilmir Usmanov b3890885c4 JVM: Break infinite loop in finding meaningful instruction
during tail-call optimization.

There can be code, where all next instructions are non-meaningful and
there is a back-edge, for example, while(true){}. Previously, analyzer
incorrectly assumed, that this cannot happen. Now, it keeps track of
visited instructions and says, that there is no meaningful instruction
in such case.
 #KT-56815 Fixed
2023-02-23 17:54:46 +00:00
Igor Chevdar 5d3b61364a Added a test for KT-56500 2023-02-23 15:32:25 +00:00
Alexander Udalov 4ad594a3cd Minor, move tests about Java field and Kotlin property
Because the `fieldRename` directory was originally about cases when
private fields are renamed because of clashes.
2023-02-23 12:54:00 +01:00
Denis.Zharkov 0c9fad87c3 K2: Fix deserialization of upper bound of type parameter in nested class
Previously, containingDeclarationSymbol for V was set to the outer class
BaseRoot, so its upper bounds was computed to the ones from TNested
at org.jetbrains.kotlin.fir.resolve.calls.CreateFreshTypeVariableSubstitutorStageKt.getTypeParameterFromExpandedClass

^KT-56706 Fixed
2023-02-21 12:35:34 +00:00
Ivan Kylchik 477d092bb8 Avoid object's interpretation with nullable type
#KT-56215 Fixed
2023-02-20 15:52:52 +00:00
Vladimir Sukharev 24696915f4 Use simplest way to split text to lines on all targets
Merge-request: KT-MR-8858
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-20 10:55:04 +00:00
Svyatoslav Scherbina 369ca6b4eb [K/N][tests] Skip CachesAutoBuildTest when cacheMode == none
These tests rely on cacheMode != none.
2023-02-20 09:21:32 +00:00
Svyatoslav Scherbina ec59cc050c [K/N][tests] Support tag expressions for :native:native.tests:test
This commits adds a Gradle project property 'kotlin.native.tests.tags',
which can be used when running :native:native.tests:test task to filter
tests by tags. The property value can contain an arbitrary JUnit tag
expression. See
https://junit.org/junit5/docs/current/user-guide/#running-tests-tag-expressions
for more details.
2023-02-17 10:37:04 +00:00
Svyatoslav Scherbina 74c39df0d8 [K/N][tests] Allow running :native:native.tests:test on TeamCity
With this task, we can be more sure that TeamCity runs all the tests.
Other test tasks in :native:native.tests project run only tests with
specific pre-defined tags, so running them on TeamCity was discovered to
be more error-prone in that regard, and is generally less flexible.
2023-02-17 10:37:04 +00:00
Vladimir Sukharev 1c055b3b23 Use proper way to remove Windows \r char for LF(EOL)
Merge-request: KT-MR-8850
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-15 18:08:08 +00:00
Svyatoslav Scherbina df450ac43c [K/N][tests] Add pre-release check tests 2023-02-15 12:26:56 +00:00
Svyatoslav Scherbina ac95ca12cf [K/N][tests] Support running the compiler without altering its output 2023-02-15 12:26:55 +00:00
Svyatoslav Scherbina e0c7d72cee [K/N][tests] Remove -Xskip-prerelease-check flag
The flag is not necessary and doesn't allow meaningfully testing
pre-release checks.
2023-02-15 12:26:55 +00:00
Igor Chevdar 951ebf4082 [K/N] Added a test for KT-56611 2023-02-15 07:06:05 +00:00
Vladimir Sukharev babd52e27a [K2/N] Fix test on Windows: remove \r from compared strings
Address reviewer's comment

Fix test on Windows: remove \r from compared strings

Merge-request: KT-MR-8799
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-14 14:46:27 +00:00
Igor Chevdar ba172358d8 [K/N] Option to specify IR validation severity 2023-02-14 07:30:47 +00:00
Vladimir Sukharev 93baad5f39 Add KotlinTestK2LibraryTest to new test infra
Merge-request: KT-MR-8766
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-11 13:58:08 +00:00
Vladimir Sukharev 6e434748d1 [K2/N] Run new stdlib tests also for K2.
Merge-request: KT-MR-8708
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-10 10:34:44 +00:00
Vladimir Sukharev ab32f90117 Put tags to klib contents tests
Merge-request: KT-MR-8641
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-08 15:42:00 +00:00
Ilmir Usmanov e42efe1ee6 JVM IR: Ignore class type parameters if function is static
Otherwise, it leads to type parameters duplication in case of
suspendImpls, since they inherit type parameters from containing class.

 #KT-56407: Fixed
2023-02-07 13:39:25 +00:00
Dmitriy Novozhilov a0bdecd22b [Test] Ignore Native codegen test with IGNORE_BACKEND_...: ANY directive 2023-02-07 09:49:20 +00:00
Dmitriy Novozhilov 075e025452 [FIR2IR] Properly generate GetObject expression for callable reference on companion object
^KT-55909 Fixed
2023-02-07 09:49:20 +00:00
Vladimir Sukharev e75d739c7a Add tests for property const initializers
Merge-request: KT-MR-8661
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-06 15:43:41 +00:00
Denis.Zharkov 6d7096b5e9 IR: Fix StackOverflowError caused by using DNN type in lambda
^KT-54140 Fixed
2023-02-03 14:08:57 +00:00
Vladimir Sukharev 08489c5734 [K2/N] KT-56218 Serialize receiver annotations
Merge-request: KT-MR-8624
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-01 13:33:55 +00:00
Pavel Kunyavskiy cb655d2d37 [K/N] Fix work with adapted function references
Their parsing was totally incorrect for K2, and sometimes incorrect for
K1. After this commit it uses same code as for JVM.

^KT-55462
2023-01-30 19:44:49 +00:00
Marco Pennekamp 9a693fa967 [FIR] Update backend tests with actual/expect in same module
- The fix for KT-55570 caused some backend tests to fail, because errors
  are now correctly reported for simple classes and actual/expect in
  the same module is not supported in FIR. See KT-55177.
- The commit also adds separate tests for K2. Unfortunately, these have
  to be disabled for K1 because K1 then reports "expect without actual"
  errors.
2023-01-30 17:17:58 +00:00
Dmitriy Novozhilov 88efa6bfb6 Update tests after switching to LV 1.9 2023-01-30 09:29:57 +00:00
Vladimir Sukharev debbfa8397 [K2/N] Add klib contents serialization tests from old testinfra
Merge-request: KT-MR-8509
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-27 23:30:45 +00:00
Ivan Kylchik 706a8a91f6 Move kt55912 test into involvesIrInterpreter dir 2023-01-27 17:15:52 +00:00
Sergej Jaskiewicz bd18fd40ea [K/N] Remap type args of SAM interfaces in FunctionReferenceLowering
#KT-56188 Fixed
2023-01-27 15:26:32 +00:00
Ivan Kylchik bc21753877 Move IR interpreter's tests from ir/loweredIr directory into box 2023-01-27 10:52:56 +00:00
Ivan Kylchik 13cad2a820 Don't save constant value for non-resolved array expression in K1
#KT-55912 Fixed
2023-01-27 09:56:35 +00:00
Vladimir Sukharev 1990883bdc [K2/N] KT-55464, KT-56091 Fix various klib annotations, including critical ones
Merge-request: KT-MR-8457
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-26 11:15:15 +00:00
Pavel Punegov 515c7f50c9 [K/N][test] Exclude properties/lateinit/isInitializedAndDeinitialize
Exclude this tests temporarily from run with one stage mode.

Merge-request: KT-MR-8408
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-01-23 11:43:28 +00:00
Ilmir Usmanov d18672bfb1 Wrap continuation with ContinuationImpl on callable references
in startCoroutineUninterceptedOrReturn. Otherwise, the coroutine will
not be interceptable later.

Add a test, which checks, that intercepted continuation is released.

 #KT-55869
2023-01-19 00:35:36 +00:00
Pavel Kunyavskiy 2843c0ad1e [K/N] Fix cleaning stack-local primitive array
^KT-55984
2023-01-18 11:52:43 +00:00
Vyacheslav Gerasimov b4071e1bbe Build: Add a separate task for K2 native codegen box tests 2023-01-17 14:25:14 +01:00
Mikhail Glukhikh 38b4bade40 K2/Native: use language version 2.0 instead of -Xuse-k2 in tests 2023-01-16 18:16:49 +01:00
Sergey Bogolepov 4ffb43c5bd [K/N] Cover objcClassesIncludingCategories with smoke tests 2023-01-16 13:26:08 +00:00
Sergey Bogolepov a9d13338bd [K/N] Make AbstractNativeCInteropTest a bit more flexible
It probably requires a bit more thoughful refactoring, but before that
we need to collect more test-cases.
2023-01-16 13:26:07 +00:00
Abduqodiri Qurbonzoda ba2833b90f Mark Base64 API with ExperimentalEncodingApi 2023-01-16 11:24:50 +00:00
Pavel Kunyavskiy 6ab00a65dd [K/N] Support volatile intrinsics on globals
Also, make intrinsics signature more consistent with other intrinsics,
e.g. with isInitialized on lateinit field.

^KT-54944
2023-01-16 08:34:24 +00:00
Pavel Kunyavskiy fc95b88eef [K/N] Tests for volatile
^KT-54944
2023-01-16 08:34:23 +00:00
Vladimir Sukharev 45de88abae [K/N][KT-39120] Build platform libraries with -fmodules
Merge-request: KT-MR-8175
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-13 07:33:42 +00:00
Sergej Jaskiewicz 4a2a77d9b9 [K/N] Make classes generated from λs that use generic parameters generic
Previously, a function reference that used generic parameters from its
outer scope was lowered into a top-level non-generic subclass of
`FunctionN`, with `FunctionN` type arguments referencing type parameters
not present in the scope anymore. This sometimes resulted in generating
malformed mangled names.

From now on the generated subclass of `FunctionN` is generic. The needed
type arguments are passed upon instantiation, when the relevant generic
parameters are present in the scope.
2023-01-12 15:32:50 +00:00
Pavel Punegov a90983ca6a [K/N][test] Sync PsiFactory creation
CoreApplicationEnvironment.registerApplicationDynamicExtensionPoint should be
guarded to ensure registration won't happen concurrently

Merge-request: KT-MR-8251
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-01-12 10:39:43 +00:00
Igor Chevdar ae56f2686a [K/N][tests] Extracted common utility functions 2023-01-11 14:13:03 +00:00
Igor Chevdar 758e9ea9ae [K/N][tests] Added a couple of tests on caches 2023-01-11 14:13:03 +00:00
Vladimir Sukharev 31a20a6631 Regenerate native tests
Merge-request: KT-MR-8207
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-05 11:02:27 +00:00