Commit Graph

23 Commits

Author SHA1 Message Date
Ilya Matveev 07c8404a5e backend: Fix enum constructor default parameters
The problem was observed in the follwing code:

enum class A(one: Int, val two: Int = one) ...

The problem is in the `two` default value. Here the enum constructor
lowering used an old (not lowered) symbol for `one`. Also the lowering
didn't copy the default expression for DEFAULT class.
The patch fixes both problems.
2017-06-14 19:42:29 +07:00
Svyatoslav Scherbina 925b1fb0b6 backend/tests: add tests for == with Nothing/Nothing? 2017-02-27 13:16:12 +07:00
Ilya Matveev c68c4d3b6d backend: Use simple DFS during closure building.
Now closure builder can contain includes. Includes
are another builders which closures must be added
to the building one.
Includes are:

For function closure:
	call targets (including constructors)
	callable reference targets

For class:
	all children declarations
	call targets (including constructors)
        callable reference targets

For constructor:
	call and callable reference targets
	delegating constructor call target
	constructing class closure
2017-02-17 15:17:46 +03:00
Ilya Matveev 95a9f65afd backend/tests: Add tests for local function closures 2017-02-17 15:17:46 +03:00
Vasily Levchenko 6310ec80c3 TEST: added defaults9 test 2017-02-16 11:40:10 +03:00
Vasily Levchenko c395bc80a0 TEST: defaults7 test enabled and defaults4 was enabled 2017-02-15 14:48:28 +03:00
Svyatoslav Scherbina cf946a7676 backend/tests: update and disable 'defaults4' 2017-01-26 13:53:40 +07:00
Svyatoslav Scherbina 3b4c25988e backend/tests: add defaults{4,5,6} 2017-01-16 10:57:40 +07:00
Vasily Levchenko a8caf7c7d8 TEST: test for default parameters
(cherry picked from commit 7999d68d812aedd5863f04b7fd2171e284b8f332)
2017-01-13 13:42:02 +03:00
Vasily Levchenko 3fe59cc46c TEST: convertion unit tests into run tests 2016-12-27 13:56:03 +03:00
Konstantin Anisimov 1b1360c77e TEST: extension function generation
(cherry picked from commit 27b8c962b2b12883150166c83c19b950c9091334)
2016-11-25 23:37:49 +03:00
Alexander Gorshenev 1d265bc50c Here goes stdlib separation.
$ gradlew backend.native:stdlib

builds you stdlib.kt.bc now.

The test runs are taught to supply
-library stdlib.kt.bc to kotlin compiler for proper imports resolution,
and then later stdlib.kt.bc is provided to clang for the final link step.
2016-11-18 19:11:38 +04:00
Konstantin Anisimov 103509d75d Tests fixed 2016-11-18 14:30:32 +03:00
Vasily Levchenko 514d1a16ec test: minus_eq fix 2016-11-18 13:54:34 +03:00
Svyatoslav Scherbina 69ee5a619a backend: add tests for === 2016-11-17 12:17:47 +07:00
Konstantin Anisimov 04822dda69 Tests for integer cmp operation added 2016-11-15 09:41:25 +03:00
Svyatoslav Scherbina f389ebf687 backend/tests: update resolved symbol names
according to new mangling scheme
2016-11-14 13:33:47 +07:00
Konstantin Anisimov a910627357 tests: added eqeq test
tests: sum-test: emproved test sum of int with various types of second argument (byte, short and etc)
tests: hello2 minor fix in test
2016-11-10 15:25:08 +03:00
Konstantin Anisimov ea149fab4e Tests for "PLUSEQ" and "MINUSEQ" 2016-11-07 18:00:30 +03:00
Konstantin Anisimov f02e0af5a2 various numeric literals' tests 2016-10-28 12:27:12 +03:00
Vasily Levchenko 3a738b2ad3 arithmetic test 2016-10-11 11:41:37 +03:00
Vasily Levchenko 97e31820ae inter-procedural call test 2016-10-11 11:24:47 +03:00
Vasily Levchenko 4c32689e1f unit test introduced:
User should create <test-name>-test.c file in the following manner:
> cat codegen/function/sum-test.c
extern void *resolve_symbol(const char*);

int
run_test() {
  int (*sum)(int, int) = resolve_symbol("kfun:sum");

  if (sum(2, 3) != 5) return 1;

  return 0;
}
and add <test-name> to the TESTS variable in the Makefile
to run tests:
> make clean run
Note: failing tests should return no zero values.
2016-10-10 15:11:55 +03:00