Commit Graph

294 Commits

Author SHA1 Message Date
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Elena Lepilkina f650311b11 [K/N] Support properties in BCE 2021-12-16 08:33:36 +00:00
Svyatoslav Scherbina 2664a4460b ObjCExport: test that completion is properly retained by continuation
Add a test that checks that Kotlin Continuation wrapping Objective-C
completion handler has strong reference to it, i.e. completion handler
doesn't get reclaimed too early.

Follow-up to 4dcfd38.
2021-12-10 10:35:36 +00:00
Svyatoslav Scherbina 59bae29d64 ObjCExport: add test for calling Unit-typed completion asynchronously
Follow-up to 4dcfd38.
2021-12-10 10:35:36 +00:00
Svyatoslav Scherbina 575c0fabb6 Native: add test for KT-38850
(the bug was fixed long ago, in 1.4-M1).
2021-12-08 13:00:15 +00:00
Igor Yakovlev d55e16a030 [WASM] Regex std implementation 2021-12-07 21:33:31 +03:00
Elena Lepilkina 219d9707ec [K/N][stdlib] Fix cases with existing pattern before matched with dot quantifier interval in regular expressions implementation(^KT-49967 Fixed) 2021-12-06 09:23:19 +00:00
Alexander Shabalin 4fd61ad1b0 [K/N] Change AtomicReference for the new MM ^KT-50026
Make AtomicReference behave like FreezableAtomicReference with the new MM: not frozen by default, don't require freezing value unless the ref itself is frozen. The behaviour with the old MM is unchanged.

Merge-request: KT-MR-5155
2021-12-03 17:08:21 +00:00
Sergey Bogolepov 3ef97511f6 [K/N] Fix testStackTraceFramework test after Xcode update 2021-12-01 08:49:51 +00:00
Pavel Kunyavskiy 8b4540f7e4 [K/N] Add test for suspend function inheritance in ObjCExport
^KT-49395
2021-12-01 07:50:39 +00:00
Ilya Gorbunov 4386a800c8 KT-49721 Avoid matching from the same position after a zero-width match
In JS, RegExp can return a match before the specified start index,
if it has matched at that index, but it is in the middle of a surrogate
pair. Account for that when advancing to the next position after
a zero-width match so that it doesn't get to the middle of SP.
2021-11-29 17:02:06 +00:00
Svyatoslav Scherbina 24e7a11abc Native: fix losing Worker.executeAfter jobs on scheduled time clash
The implementation was keeping delayed jobs in std::set sorted
only by the scheduled execution time (in microseconds since epoch).
So two jobs submitted to a worker and having the same scheduled time
were considered equivalent by the set, and one of them got lost.

Fix this by using std::multiset instead of std::set.
2021-11-26 11:59:40 +00:00
Pavel Punegov 8be2196ea9 [Native][test] Fix testLibrary dependency 2021-11-26 10:13:05 +00:00
Pavel Punegov d73f8ea44e [Native][Test] Fix platformLibs dependencies
Sanity tests should not run tests that depend on platform libs. Also
fix platform libs dependency setting
2021-11-26 10:13:04 +00:00
Nikolay Krasko af8faadca5 Update internal project junit dependency 4.12 -> 4.13.2 2021-11-24 19:35:31 +03:00
Svyatoslav Scherbina 9476d4c647 Native: use Gradle exec for jsinterop invocation in jsinterop_math test
The previous implementation didn't log anything, including stdout,
stderr and the command line, and didn't detect non-zero exit code,
making it hard to investigate the test failures.
2021-11-19 11:54:46 +00:00
Igor Chevdar cb71240938 [K/N] Supported outer this references from cached inline bodies 2021-11-18 17:52:57 +05:00
Nikolay Kasyanov 4dcfd38236 ObjCExport: remove KotlinUnit from suspend funs returning Unit (#4635)
With `unitSuspendFunctionObjCExport=proper` binary option,
for Unit-returning suspend functions ObjCExport now generates
completion handlers without redundant `KotlinUnit*` result parameter.

So Swift (5.5+) can import these functions as Void-returning async
functions.

^KT-47399 Fixed
2021-11-18 10:01:33 +03:00
Pavel Punegov 960ba3ffde [K/N] Excluded filecheck test on wasm32. See KT-49739 2021-11-17 09:40:52 +00:00
Svyatoslav Scherbina 2f5706597a IR: fix offsets in irTemporary
The variable generated by IrStatementBuilder.irTemporary doesn't inherit
startOffset and endOffset from the builder. In particular, as a result,
temporary variables generated for elvis operator left operand have
UNDEFINED_OFFSET.

Additionally, ProvisionalFunctionExpressionLowering copies the offsets
of a variable to lowered lambda in the variable initializer. With the
problem described above, this causes invalid debug information in
Kotlin/Native, see KT-49360.

Fix irTemporary by using builder's offsets for the variable.

^KT-49360 Fixed
2021-11-16 11:59:55 +00:00
Elena Lepilkina c06875b8e9 [K/N] Added test for exceptions behaviour in case of dynamic libs (KT-47828) 2021-11-16 10:44:53 +00:00
Dmitriy Dolovov a029b50755 [Native][tests] Enable codegen_box_callableReference/genericConstructorReference.kt 2021-11-15 18:15:42 +03:00
zhelenskiy c1dc1f7e33 Diagnostics renamed
Signed-off-by: zhelenskiy <zhelenskiy2000@yandex.ru>
2021-11-13 12:38:45 +01:00
Pavel Kunyavskiy 523cb4b3e8 [K/N] Better handling of nested returns in RedundantCoercionsCleaner.kt
^KT-49356
2021-11-12 19:12:37 +00:00
Pavel Punegov 475b3a452e [K/N][test] Disable tests on wasm due to ^KT-48738 2021-11-11 13:34:25 +00:00
Pavel Punegov e07fa31784 [K/N][build] Move KLibInstall to Konan gradle plugin 2021-11-11 12:16:26 +00:00
Pavel Punegov 151cb096ce [K/N][test] Replace genKt39548 task with doBeforeBuild closure 2021-11-11 12:16:25 +00:00
Svyatoslav Scherbina ea7160947a Native: enable lazy IR generation before running fake override builder
^KT-48816 Fixed

Native compiler uses lazy IR for declarations provided by cinterop.
The problem: `FakeOverrideBuilder` requests super types during
type checking, accessing `.owner` for them. So if a type and super type
are represented as lazy IR, and lazy IR generation is not enabled yet,
then the super type symbol won't be bound by this moment, and the access
will fail.

This happens in KT-48816: fake override builder tries to access `.owner`
for `IrClassSymbol` of `NSObject` (super type of `NSDate` and `NSUUID`).

Fix this by enabling lazy IR generation before building fake overrides.
2021-11-10 12:30:12 +00:00
Svyatoslav Scherbina c929404fa4 Native: don't treat any compiler test task as up-to-date
There are number of problems with up-to-date checks in tests, leading to
a test binary not being rebuilt or rerun when a developer expects it to.

Things became worse after updating to Gradle 7+:
test binary run tasks are considered up-to-date if the test data
has been changed, even after clean.

Even before Gradle 7+, we've observed other similar undesirable effects:
for example, if the compiler has been changed, tasks building
test binaries are still up-to-date.

There are quite a lot of different tasks related to running the tests
for Native, many of them are misused and thus don't do what we expect.
Carefully fixing each particular kind seems counterproductive and
unreliable.

So instead workaround all possible similar problems by forcing all tasks
in the :kotlin-native:backend.native:tests project to be not up-to-date.

This project should contain only test tasks, so this workaround
seems pretty natural -- it is just "tests aren't up-to-date".
2021-11-09 11:18:08 +00:00
Pavel Punegov a207a3e8fa [K/N][test] Don't use assertFailsWith on wasm32 in the test 2021-11-09 09:55:13 +00:00
Sergey Bogolepov bc144887ea [K/N] Add native test for KT-48591
We can't rely on stdlib tests now, because they are not
executed with compiler caches.
2021-11-09 08:27:58 +00:00
Pavel Kunyavskiy f4a88bde4e [K/N] Force static constants and boxing caches be same values
^KT-49403
2021-11-03 07:21:25 +00:00
Elena Lepilkina 15dcfa2837 [K/N] Fix new FileCheck tests after rebase 2021-11-02 12:04:45 +00:00
Elena Lepilkina d8c9536edd [K/N] Fixes in tests and check function in optimized mode 2021-11-02 12:04:44 +00:00
Elena Lepilkina 23e5079391 [K/N] Added test for checking C callback set with Kotlin function throwing exception 2021-11-02 12:04:43 +00:00
Elena Lepilkina 751f1a3b91 [K/N] Added FileCheck for noreturn attribute absence for suspend functions 2021-11-02 12:04:42 +00:00
Elena Lepilkina dba645bce1 [K/N] Fix FileCheck test, now compiler produces call instruction 2021-11-02 12:04:39 +00:00
Sergey Bogolepov d072a3ca59 [K/N] Fix fileCheckTest temporary files dir 2021-10-29 04:07:31 +00:00
Sergey Bogolepov 95bd5fcc4b [K/N] Update filecheck tests for different ABIs 2021-10-29 04:07:31 +00:00
Sergey Bogolepov fdd020eab6 [K/N] Tests for function attributes in bitcode generator
Besides, well, tests themselves, this commit extends FileCheck infra to
make it possible to test bitcode for direct and reverse interop.
2021-10-29 04:07:30 +00:00
Alexander Shabalin c678702847 [K/N] Add tests on Atomic integers ^KT-49348 2021-10-27 13:54:35 +00:00
Elena Lepilkina 453e4b1830 [K/N] Added FileCheck tests on bound check elimination 2021-10-27 12:02:06 +00:00
Mikhail Glukhikh 37b95972db Uncomment warning about -Xopt-in deprecation 2021-10-26 13:38:40 +03:00
Svyatoslav Scherbina 99447a11c1 Native: fix ^KT-49384
Don't report errors for projections in nested type arguments of
SAM conversion target types.
2021-10-26 10:12:30 +00:00
Svyatoslav Scherbina 65bea27431 Native: add test for ^KT-48876
The issue itself was already fixed in 981a6ffe.
2021-10-26 10:10:26 +00:00
Pavel Kunyavskiy 172373c57e [K/N] Add tests for flexible arrays in interop
^KT-48074
2021-10-19 13:45:00 +00:00
Sergey Bogolepov 8d2234b37a Add a test for KT-49212 2021-10-18 07:19:11 +00:00
Igor Chevdar f1c1094393 [K/N][optmz] Fix for https://youtrack.jetbrains.com/issue/KT-49234 2021-10-15 14:08:17 +00:00
Pavel Kunyavskiy 533eb589cb [K/N] Add tests for static initialisation of ConstantValues 2021-10-14 11:22:28 +00:00
Pavel Kunyavskiy 504d72011b [K/N] Transform FunctionReference without bound values to ConstantValue 2021-10-14 11:22:26 +00:00