Commit Graph

353 Commits

Author SHA1 Message Date
pyos acce055fc4 FIR: fix incorrect handling of suspend function typealiases again
The previous attempt stopped this code from throwing an exception during
serialization, but the arity is still wrong so an exception is now throw
when reading the serialized type.

^KT-50997 Fixed
2022-09-12 17:45:40 +02:00
Vladimir Sukharev c8864369fd Use main class as test generator name
Merge-request: KT-MR-7031
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-09 12:51:18 +00:00
Pavel Mikhailovskii 0b453ee328 KT-41670 Check for default property accessors in SAM interfaces 2022-09-07 13:37:38 +00:00
Pavel Mikhailovskii a75d5ba4cf KT-53465, KT-53677 Get rid of unnecessary checkcasts to array of reified type 2022-09-06 18:33:38 +00:00
Alexander Korepanov 01507281a2 [Common IR] Forward the extension receiver in the reified wrapper
^KT-53672 Fixed
2022-09-05 07:40:30 +00:00
Dmitriy Dolovov 6b6bc7d6fe [Native][tests] Fix: Pass friend modules to compiler CLI when building static cache
^KT-53723
2022-08-30 07:56:17 +00:00
Pavel Kunyavskiy 895a8ff149 [K/N] Basic support of Enum.entries for Native
No forward compatibility yet, with old klib IR linker will fail.

^KT-53324
2022-08-25 12:40:30 +00:00
Steven Schäfer a90c4d5dd5 JVM IR: Optimize equality on class literals 2022-08-23 00:14:11 +02:00
Nikita Bobko 2a4f3f41aa 2/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Note: Kotlin Maven artifacts (./gradlew publish) changed their
dependency on kotlin-reflect
2022-08-22 15:43:49 +02:00
Igor Chevdar ccb4b5fd7d Revert "[Native][tests] Temporarily disable String codegen/box tests with "-opt" mode"
This reverts commit b210e24b43.
2022-08-22 06:05:53 +00:00
Pavel Kunyavskiy 5034581788 [K/N] Fix references for inline function
Corresponding lowering creating wrappers from JS Backend was used.

Also, the lowering was changed to create local function, instead of
normal one in outer scope, as a lot of logic from local declarations
lowering should be duplicated otherwise for correct type parameters
handling.

^KT-38535
2022-08-18 13:23:10 +00:00
Vsevolod Tolstopyatov c0f81cbc45 [JVM] Improve code coverage of EntriesMapping
Ensure that when .entries is accessed from an inline function body
or lambda argument, EntriesMapping are properly generated and used
without excessive mappings and duplicated fields

#KT-53236
2022-08-12 09:35:24 +00:00
Pavel Mikhailovskii 8ba80b4b7b KT-1436 Allow break/continue in inlined lambdas 2022-08-11 10:38:23 +00:00
Pavel Kunyavskiy 18cda8844d [K/N] Fix possible data races found by thread sanitizer 2022-08-10 08:36:07 +00:00
Pavel Kunyavskiy 828811a47f [K/N] Support running with thread sanitizer in test infra 2022-08-10 08:36:05 +00:00
Dmitriy Dolovov b507975812 [Native][tests] Make InfrastructureDumpedTestListingTest to be line ending tolerant 2022-08-09 12:32:22 +00:00
Alexander Korepanov bb8da65188 [Common IR] Do inlining of callable references of inline functions
^KT-52805 Fixed
2022-08-08 17:40:45 +00:00
Pavel Kunyavskiy 3424e756ad [K/N] Fix for instantiating annotations from already lowered file
If annotation class is already lowered, it can have more than one
constructor. So we should use primary one, not any one.

^KT-53475
2022-08-08 16:35:22 +00:00
Alexander Korepanov 794229d012 [box-tests] Add tests about anonymous classes uplifting
^KT-50175 Fixed by commits before
2022-08-08 08:39:59 +00:00
Igor Chevdar e38f02b53a [box-tests] Added a bunch of tests on local objects in inline lambdas 2022-08-08 08:39:57 +00:00
Igor Chevdar 03d21d9f79 [K/N][box-tests] Supported running box tests with per-file caches 2022-08-06 17:40:28 +00:00
Igor Chevdar 6799988227 [box-tests] Added a multi-module test on lateinit properties 2022-08-06 17:40:27 +00:00
Vsevolod Tolstopyatov 14b13a2f17 [kotlin.reflect] Introduce ClassValue-based cache for KClassImpl
* Replace pcollections with ClassValue/ConcurrentHashMap-based caches
* Do not store weak references, instead cache strong references and count on ClassValue to unload the corresponding classloader if necessary
* ConcurrentHashMap does not rely on WeakReference as it's only selected on Android where classloader leaks don't exist
* Update reflect/scripting JDK requirement to Java 8 in order to proceed

#KT-53454
#KT-50705


Merge-request: KT-MR-6788
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2022-08-05 15:35:34 +00:00
Dmitry Gridin 4ceb170917 regenerate tests 2022-08-05 14:12:41 +02:00
Ilya Gorbunov f91ea4b4d9 Add more tests for 'contains' in ranges #KT-52933
- ranges produced by 'rangeUntil' operator
- ranges of unsigned values
- more elements in ranges produced by `downTo`
2022-08-03 22:18:14 +00:00
Steven Schäfer 03aee58585 JVM IR: Avoid IrComposite in ReturnableBlockLowering (KT-53202) 2022-08-03 00:19:31 +02:00
Svyatoslav Scherbina 1b131332ab [Native][tests] Simplify handling opt-ins in the test launcher
For a box test, the test engine generates a test launcher -- a function
that calls `box` function. The latter might require an opt-in. To deal
with this, the test engine was using some heuristics to detect possibly
used opt-ins and applied them to the test launcher.

This commit provides an alternative solution -- it uses
`@Suppress("OPT_IN_USAGE_ERROR")` annotation for the test launcher. This
way, it doesn't have to guess which opt-ins to apply.
2022-08-01 15:24:15 +02:00
Svyatoslav Scherbina 09c131afd2 [Native][tests] Add standalone test for KClass package names
To ensure that after introducing `ReflectionPackageName` annotation,
we still have tests that check KClass package names without it.
2022-08-01 15:24:15 +02:00
Svyatoslav Scherbina c1853a0218 [Native][tests] Introduce NATIVE_STANDALONE directive
This directive makes the test standalone, i.e. disables grouping it with
other tests into a single compilation, and in particular disables
package renaming for the test.

Also, remove the old hard-coded way to mark tests standalone.
2022-08-01 15:24:10 +02:00
Svyatoslav Scherbina d50b0693b2 [Native][tests] Don't make typeOf tests standalone
The test engine detected tests using typeOf and made them "standalone",
i.e. disabled test grouping and thus package renaming for them, to keep
the reflection information intact.

Now, with `ReflectionPackageName` annotation, this is not required
anymore.
2022-08-01 15:23:38 +02:00
Svyatoslav Scherbina cee0731cef [Native][tests] Keep reflection package name when renaming packages
The test engine renames packages in test files to allow group many tests
into single compilation for performance reasons.

As a result, reflection APIs return different package names. To deal
with this, the test engine uses certain heuristics to detect tests using
reflection APIs, and disables grouping (and thus package renaming) for
them.

This commit provides an alternative solution for the same problem --
now the test engine instructs the compiler to use original package names
for reflection information, by means of the introduced
`ReflectionPackageName` annotation.
2022-08-01 15:23:32 +02:00
Svyatoslav Scherbina 38723816b7 [Native][tests] Fix file annotation patching in test files
Previously, the test engine was copying @file:OptIn annotations from
each file to all the other files inside the same test data, and also was
removing other file annotations in certain cases.

Now it only adds the opt-ins specified with `!OPT_IN` directives, and
doesn't remove anything.
2022-08-01 15:23:19 +02:00
Mads Ager e46540729c Fix equality for generated test files.
They were compared based on the name of the file only disregarding
the module. Therefore, the test framework would only patch
package declarations for one file with a given name even if there
were multiple files with that name in different packages.
2022-08-01 08:57:17 +00:00
Steven Schäfer 6f0ff6aeb0 IR: Fix scope transparency in ReturnableBlockLowering
An IrReturnableBlock introduces a new variable scope and shouldn't be
replaced with a transparent IrComposite block.
2022-07-29 01:06:44 +02:00
Igor Chevdar 8981eb85de [box-tests] Added a couple of reproducers for KT-52795 2022-07-28 16:01:17 +00:00
Dmitriy Dolovov b210e24b43 [Native][tests] Temporarily disable String codegen/box tests with "-opt" mode 2022-07-27 22:39:34 +00:00
Dmitriy Dolovov 5d234c0cdc [Native][tests] Ability to programmatically mute codegen/box & regular tests 2022-07-27 22:39:33 +00:00
Ilya Gorbunov 1addc23b23 Add range iteration tests for rangeUntil
#KT-52932
2022-07-26 23:52:10 +00:00
Dmitriy Dolovov 8adb0528d7 [Native][tests] Don't use non-default runtime assertions mode with cache
^KT-53032
2022-07-20 14:43:08 +00:00
Dmitriy Dolovov 7bc0132cca [Native][tests] Don't fail tests on expected partial linkage warnings 2022-07-18 17:29:51 +02:00
Dmitriy Dolovov 66de825508 [Native][tests] Unmute klibABI/remove[Property|Function] tests
This reverts commit d60c93c1f8.
2022-07-18 17:29:50 +02:00
Dmitriy Dolovov 8283537673 [Native][tests] Don't fail tests on partial linkage warnings 2022-07-18 17:29:50 +02:00
Dmitriy Dolovov ce04a24b26 [IR][tests] Removal of class used as variable type and constructor call 2022-07-18 17:29:50 +02:00
Dmitriy Dolovov d5ded97ccb [IR][tests] Removal of inlined class case
^KT-52478
2022-07-18 17:29:50 +02:00
Dmitriy Dolovov 7b5e33b6ca [IR][tests] Add tests for removal-of-typealias case 2022-07-18 17:29:49 +02:00
Dmitriy Dolovov 89a188d199 [IR][tests] Add tests for remove-inlined-callable member case 2022-07-18 17:29:49 +02:00
Dmitriy Dolovov 9c1c712057 [IR][tests] Add tests for removal-of-overridden open callable case 2022-07-18 17:29:49 +02:00
Steven Schäfer 8014712569 JVM IR: Check that we generate callable references in tests 2022-07-14 23:24:18 +02:00
Pavel Kunyavskiy 5cdda48487 [K/N] Extract const val initializers to place of usage
This would make behaviour more consistent with jvm. There is still
a difference in behaviour about point where side effects happen.

^KT-52970
2022-07-13 08:49:40 +00:00
Igor Chevdar e36bd5fe90 [box-tests] Added a multi-module box test 2022-07-13 08:01:51 +00:00