Commit Graph

50 Commits

Author SHA1 Message Date
Ilya Gorbunov 62fe89b536 Make several tests running on JS backend. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov 0899a0fdda Make some tests JVM only 2016-11-21 18:20:33 +03:00
Ilya Gorbunov 38840bb529 Do not reference java.util in tests that run on JS backend. 2016-11-21 18:20:33 +03:00
Dmitry Petrov 8b99141030 KT-14839 Do not coerce after remapped variable store. 2016-11-18 09:35:31 +03:00
Alexey Andreev b5358122e2 JS: unmute shared box tests 2016-11-16 19:50:10 +03:00
Dmitry Petrov b429f7bc86 KT-14581 Make FixStackAnalyzer tolerant to uninitialized values 2016-11-11 13:30:15 +03:00
Zalim Bashorov 596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Michael Bogdanov 486aa5675f Fix for KT-12908: Variable initialization in loop causes VerifyError bad local variable type
#KT-12908 Fixed
2016-07-09 07:45:57 +03:00
Michael Bogdanov dec53c8d6c Fix for KT-11762: "VerifyError: Bad local variable type" caused by explicit loop variable type
#KT-11762 Fixed
2016-04-05 13:37:10 +03:00
Mikhail Glukhikh b7e8f71367 Fix of getCorrespondingLoop for complex loop / try-finally trees #KT-8246 Fixed 2016-03-30 18:49:23 +03:00
Alexander Udalov bab127ad33 Remove some legacy codegen tests, move some to generated 2016-03-09 10:25:38 +03:00
Alexander Udalov 06a67e6602 Merge boxWithStdlib testData into box, delete BoxWithStdlib test 2016-03-09 10:25:38 +03:00
Ilya Gorbunov 4d5ec9be3f Drop identityEquals from builtins, compiler and tests. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov b97e436a50 Fix deprecated Range and Progression usages in testData 2016-01-22 05:54:38 +03:00
Dmitry Petrov b736880787 KT-6646, KT-10482:
when a method (or a property getter) returns Nothing, emit
  ACONST_NULL
  ATHROW
after a call so that class files verifier knows that this is an exit point in a method.
Note that if an inline method returning Nothing throws an exception explicitly
(or via a chain of inline methods), this code will be deleted by DCE.
2015-12-31 11:07:56 +03:00
Yan Zhulanow 9d1af5a17e Fix tests: "infix modifier required" and "operator modifier required" errors 2015-11-27 15:51:11 +03:00
Michael Bogdanov 3f995935d3 Fix for KT-9022: Wrong result when use break in if condition
#KT-9022 Fixed
2015-11-13 10:14:00 +03:00
Ilya Gorbunov 5e6d16103e Remove deprecated ranges from tests and take into account that Byte and Short rangeTo now returns IntRange. 2015-11-11 03:53:31 +03:00
Dmitry Petrov ccad435850 KT-9644: override default behavior for non-local return in FixStackAnalyzer 2015-10-26 15:56:57 +03:00
Yan Zhulanow e14c9645dc Error on 'if' without an 'else' branch when used as an expression 2015-10-19 03:56:15 +03:00
Denis Zharkov bd37a10677 Transform *Array.size to properties 2015-10-16 18:16:02 +03:00
Denis Zharkov 17c906658d Transform Throwable members to properties 2015-10-14 20:39:59 +03:00
Denis Zharkov f0e3fd617d Adjust testData to CharSequence.length transformation 2015-10-14 20:39:35 +03:00
Alexey Tsvetkov 62c25c0370 Replace is Array<T> with .isArrayOf<T>() 2015-10-14 18:36:53 +03:00
Dmitry Petrov a64f1a86c0 Fix KT-8608: Compiler crashes with assertion Restore stack is unavailable
- fix SAVE_STACK_BEFORE_TRY insertion:
  TRYCATCHBLOCK LA, LB, LC
  LA
    NOP
    try_body
  LB
    ...
  LC
    handler_body
should be transformed into:
  LA
    {SAVE_STACK_BEFORE_TRY}
  LA' // new TCB start label
    NOP
    try_body
  LB
    ...
  LC
    handler_body
with all TCBs start labels remapped

- properly wrap exceptions from MandatoryMethodTransformer

 #KT-8608 Fixed
2015-07-27 10:40:14 +03:00
Dmitry Petrov 4e42cc6b81 Save/restore stack in try-expressions (and statements).
Parse TryCatchBlockNode's in generated bytecode, infer stack save/restore points.
Save stack to local variables before 'try'.
Restore stack after the beginning of try-block, catch-block, and default handler.
Integrate before/after inline markers rewriting (otherwise it'll break our stacks).

 #KT-3309 Fixed
2015-07-07 12:16:29 +03:00
dnpetrov c24e6b5698 Support 'break' and 'continue' in expressions
- generate fake jump instructions so that we can always analyze stack depths
- fix stack before break and continue by dropping excessive elements (e.g., *a*.foo(*b*, c?:continue))
- Analyzer rewritten in Kotlin, with more flexible control of CFG traversal

 #Fixed KT-3340
 #Fixed KT-4258
 #Fixed KT-7941
2015-06-25 17:40:55 +03:00
Michael Bogdanov 93c5a52d13 Updated exception table generation: try block return moved to uncatched interval
#KT-8148 Fixed
2015-06-24 09:48:55 +03:00
Dmitry Jemerov 4bdf598bfe compiler testdata: s/trait/interface 2015-05-12 19:43:17 +02:00
Denis Zharkov 44a55e5bf6 Adjust testData to new labels syntax 2015-04-29 14:03:11 +03:00
Stanislav Erokhin 3de0dff575 Migrate testdata to new lambda syntax 2015-04-07 13:08:53 +03:00
Alexander Udalov 6cd6704bcf Remove obsolete codegen test data 2014-12-29 19:32:09 +03:00
Denis Zharkov 654411a0b0 Refactored tests using Array constructor:
Some moved to tests with stdlib
Some changed to use arrayOfNulls
2014-12-11 16:04:03 +03:00
Alexander Udalov a7b88e9485 Make CharSequence.length a function instead of property
And String.length as well.

This is done for JVM interoperability: java.lang.CharSequence is an open class
and has a function 'length()' which should be implemented in subclasses
somehow.

A minor unexpected effect of this is that String.length() is now a compile-time
constant (it wasn't such as a property because properties are not supported in
compile-time constant evaluation)

 #KT-3571 Fixed
2014-11-27 20:38:17 +03:00
Alexander Udalov 93696ff9bd Make Array.indices extension property, move to stdlib
This is not something that needs to be intrinsified. Note that compiler
optimizations are still possible and the fact whether 'indices' is a member or
an extension is irrelevant to the optimizer
2014-11-17 15:20:44 +03:00
Alexander Udalov 128c938965 Make Array.size() a function instead of a property
Also add a deprecated extension property to help migration. This is done to
unify getting size of arrays and collections
2014-11-17 15:02:38 +03:00
Svetlana Isakova 4a1a95ea36 Rename: casted -> cast 2014-10-18 11:06:53 +04:00
Michael Nedzelsky 25a0854dbd fix KT-5645: 'continue' inside 'do...while' statement works as goto to the beginning of the loop (not checking loop condition)
#KT-5645 Fixed
2014-09-05 18:31:53 +04:00
Zalim Bashorov c767ffc3e7 Unit.VALUE -> Unit in testData 2014-07-25 17:16:40 +04:00
Andrey Breslav 777f3d1341 Codegen tests now fail on JVM-specific errors 2014-06-19 22:11:57 +04:00
Alexander Udalov f7b6457139 Replace "jet" package name with "kotlin" in testData 2014-03-02 19:55:26 +04:00
Alexander Udalov 4aa6a42483 Support codegen of empty for-loop
#KT-3009 Fixed
 EA-35742 fixed
2013-12-04 15:19:56 +04:00
Alexander Udalov 61ff9eb45b Support codegen of empty do-while-loop
#KT-3009 In Progress
2013-12-04 15:19:56 +04:00
Alexander Udalov 9058272528 Support codegen of empty while-loop
#KT-3009 In Progress
2013-12-04 15:19:56 +04:00
Alexander Udalov 4cd4026174 Support empty if-statements
Type-check "if (...) ;" to Unit, report "implicit cast to Unit", propagate data
flow info out of its condition

 #KT-2478 Fixed
2013-12-04 15:19:47 +04:00
Alexander Udalov c8a5c9ef59 Add regression for EA-47864 2013-09-06 21:16:42 +04:00
Alexander Udalov 8a14b62a23 KT-3574 Assertion error when using ?: in for range
#KT-3574 Fixed

Do not assert that resolvedCall is non-null, since getRangeAsBinaryCall can
return a BinaryCall that doesn't represent a range at all (as specified by the
comment in getRangeAsBinaryCall)
2013-06-20 16:03:00 +04:00
Alexander Udalov 4ca522bf0e Fix codegen of do-while condition
The condition of a do-while loop can use variables declared in the loop
(variables can only be declared inside a block). Previously this behaviour
caused crash because after the block was generated, all variables declared
inside that block were gone from myFrameMap

 #KT-3280 Fixed
2013-02-04 15:30:38 +04:00
Evgeny Gerashchenko 9fa3e47b65 Added start and end property to generic range. 2013-01-29 22:55:05 +04:00
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00