Commit Graph

47 Commits

Author SHA1 Message Date
Dmitry Savvinov
5cb949ad7f Fix language features in tests for gradual migration to 1.3 (part 2)
In 1.3, due to changes in language, testdata for some tests can be
different from 1.2

We want to simlultaneously test both versions, so instead of fixing
language version in such tests, we split them into two: one with fixed
1.2, another with fixed 1.3
2018-07-05 10:42:49 +03:00
Mikhail Glukhikh
c0e1b3ef2d CFG: fix label binding for last instruction of finally block
So #KT-18698 Fixed
2017-07-18 14:37:13 +03:00
Denis Zharkov
02b40326cc Fix incorrect coroutines codegen behavior
If all the suspension calls in a suspend function were "hidden"
under the for-convention (iterator/next/hasNext) calls,
control-flow didn't find them, thus supposing that there is no
suspension points and there is no need to generate a coroutine state machine

The solution is to add relevant calls to CFG

 #KT-15824 Fixed
2017-01-25 13:54:01 +03:00
Mikhail Glukhikh
b81268cca1 Control-flow analysis: do-while scope is ended after condition but before jump #KT-15334 Fixed 2017-01-10 17:57:43 +03:00
Mikhail Glukhikh
f8039249c6 CFA: additional jumps to catch / finally generated in the end of try / before exits from try #KT-5469 Fixed
Also #KT-13612 Fixed
(cherry picked from commit 7c188b3)
2016-08-31 19:28:09 +03:00
Mikhail Glukhikh
25eefdb6ec Pseudocode label now cannot be bound to a non-owning pseudocode #KT-13555 Fixed
Also EA-77641 Fixed
(cherry picked from commit 07643ce)
2016-08-25 10:32:04 +03:00
Ilya Gorbunov
58a010464a Exception typealiases rendering in test output (CFG) 2016-08-17 12:40:50 +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
Mikhail Glukhikh
569a5888ff do...while (true) is now considered infinite loop in CFA #KT-3896 Fixed
Also #KT-3883 Fixed
Also #KT-4986 Fixed
2016-03-14 16:13:14 +03:00
Mikhail Glukhikh
b805ce06c2 CFG exhaustive when else instruction for KT-8700 2015-12-26 10:46:01 +03:00
Mikhail Glukhikh
ea3a65d0b8 Additional tests for KT-10243 2015-12-02 18:14:59 +03:00
Denis Zharkov
e9cd9db2a7 Adjust testData after contains transformation 2015-10-09 14:40:34 +03:00
Denis Zharkov
73799e2c3c Replace deprecated lambda syntax in testData
It's done with similar constructions where possible trying to preserve
intended behavior.
Some usages are removed because they test exactly the feature that
we are going to drop soon.
2015-09-25 08:29:25 +03:00
Alexey Sedunov
3d3b5591e1 Control-Flow: Improve debug text of ReadValueInstruction 2015-05-26 19:28:09 +03:00
Mikhail Glukhikh
0d7f649cc2 Implementation of exhaustive whens in control flow analysis.
Now control flow analyzer knows when is exhaustive.
If despite of this all conditions are accidentally false, jump to error is generated.
A set of tests (diagnostic, control flow). #KT-5113 Fixed. #KT-6046 Fixed. #KT-1882 Fixed.
2015-05-18 19:44:29 +03:00
Denis Zharkov
44a55e5bf6 Adjust testData to new labels syntax 2015-04-29 14:03:11 +03:00
Alexey Sedunov
56031cb270 Control-Flow Analysis: Fix bug in finally-block repetition in the presence of non-local returns
#EA-65982 Fixed
2015-03-11 23:33:57 +03:00
Andrey Breslav
0cbbb6a0db Test data fixed 2014-10-13 15:37:47 +04:00
Svetlana Isakova
f5feb3bf33 Fixed: label copies should be added to all labels 2014-09-07 01:04:01 +04:00
Svetlana Isakova
976d5ab030 Pseudocode: don't write full label name when jump on it 2014-09-07 01:04:00 +04:00
Svetlana Isakova
61dc110cc7 Report 'break or continue outside a loop'
for break/continue outside a loop body (e.g. in loop condition)

 #KT-5724 Fixed
2014-09-07 01:03:57 +04:00
Svetlana Isakova
0b4f313b6d Jump on 'continue' to condition entry points for all loops 2014-09-05 18:31:53 +04:00
Svetlana Isakova
3d7c22f242 Added exact label names for labels 2014-09-05 18:31:53 +04:00
Alexey Sedunov
9fee8600cb Pseudocode: Do not generate implicit return instruction inside of
Unit-typed lambdas
 #KT-5549 Fixed
2014-08-05 18:14:40 +04:00
Alexey Sedunov
9f3ebe5f3b Pseudocode: Generate merge instruction regardless of number of branches 2014-07-28 13:07:32 +04:00
Alexey Sedunov
77bbf8f73b Pseudocode: Generate fake values for Unit/Nothing-typed expressions 2014-07-28 13:07:29 +04:00
Alexey Sedunov
b0bf11c51e Pseudocode: Consume value of true condition in while-loop 2014-07-28 13:04:01 +04:00
Alexey Sedunov
ffd4af872c Pseudocode: Track merged values. Compute closure of value usages over merge instructions. Exclude merge instructions from usage lists 2014-07-28 13:03:09 +04:00
Zalim Bashorov
c85ec97589 Minor: revert dc68d78 (Minor: revert changes in StackValue and fix tes data. another fixes) 2014-07-25 17:16:40 +04:00
Zalim Bashorov
dc68d78d9d Minor: revert changes in StackValue and fix tes data.
(this commit should be reverted after make Unit object)
2014-07-11 20:28:57 +04:00
Alexey Sedunov
487e7f2a91 Pseudocode: Replace {<: Any?} type predicate with * 2014-07-11 19:13:52 +04:00
Alexey Sedunov
4707f4a5e9 Pseudocode: Add debug information to magic instructions 2014-07-11 19:13:49 +04:00
Alexey Sedunov
d636d362b7 Pseudocode: Generate proper instructions for when conditions. Eliminate unnecessary magics 2014-07-11 19:13:46 +04:00
Svetlana Isakova
aa26db0538 Updated tests for control flow: call instruction stores call element
instead of callee expression
2014-07-08 14:57:38 +04:00
Alexey Sedunov
f226d99d36 Pseudocode: Add valued instructions and unbound values to AbstractPseudoValueTest 2014-06-26 13:06:23 +04:00
Alexey Sedunov
5e2c2b4eca Pseudocode: Implement computation of expected type predicates 2014-06-23 19:32:25 +04:00
Svetlana Isakova
9480907514 Mark some expressions after processing their components
when it's semantically correct

Expressions: calls, 'for' loops, elvis operators
It's significant for reporting 'unreachable code' correctly
2014-06-21 12:26:32 +04:00
Alexey Sedunov
168b32920b Pseudocode: Do not bind call value to callee expressions 2014-06-19 22:04:44 +04:00
Alexey Sedunov
587a9558bc Pseudocode: Introduce "merge" instruction 2014-06-19 22:04:39 +04:00
Alexey Sedunov
4a5d2e6728 Add tests for element -> pseudo-value mapping 2014-06-03 18:17:07 +04:00
Alexey Sedunov
d2c055e9da Pseudocode: Introduce pseudo-value analysis 2014-06-03 18:17:05 +04:00
Svetlana Isakova
e0f37bbef0 Generate parse error on label without name '@' 2014-05-20 15:07:03 +04:00
Tal Man
aeb5bae556 Refactoring of CompileTimeConstant, introduce flag to represent a constant being referenced by a variable 2014-04-09 14:47:05 -04:00
Svetlana Isakova
7d46ff951e Jump after 'for' cycle to loop parameter change.
Not to the cycle body.
2014-03-07 21:08:17 +04:00
Svetlana Isakova
006f3ccbe9 Added/updated tests for LexicalScope. 2014-03-07 21:08:16 +04:00
Svetlana Isakova
1fc4573a8c removed duplication of pseudocode in tests
for local functions
2014-03-07 21:08:15 +04:00
Svetlana Isakova
ec47821567 restructured control flow tests 2014-03-07 21:08:14 +04:00