Commit Graph

40 Commits

Author SHA1 Message Date
Nikolay Igotti af85121b2c Add primitive types to String conversion. (#50) 2016-11-11 14:16:15 +03: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
Nikolay Igotti 00fdc90d43 Hack to run tests on Linux. 2016-11-08 18:31:45 +03:00
Nikolay Igotti 91035b692b Add more console operations, nicer naming in natives. (#46) 2016-11-08 17:38:36 +03:00
Alexander Udalov a7bef2d0ee Lower priority of compiler built-ins in resolution (#43)
* Remove unneeded module context creation in K2Native

Calling this method is useful only when its result is used

* Use JvmAbi from compiler instead of reflection implementation

Package "kotlin.reflect.jvm.internal.impl" is internal implementation detail of
kotlin-reflect and should not be used

* Run native back-end with "-ea"

This allows to get more detailed messages in case something fails

* Lower priority of compiler built-ins in resolution

CREATE_BUILT_INS_FROM_MODULE_DEPENDENCIES makes sure that the "built-ins" that
the compiler front-end uses during the resolution are loaded from the module
being resolved itself, i.e. from its sources and/or dependencies. E.g. if
there's a class named kotlin.Any in module sources, it'll become the default
supertype for any class without an explicit supertype.

ADD_BUILT_INS_FROM_COMPILER_TO_DEPENDENCIES adds the built-ins from the
compiler jar to the end of the dependencies list of the module being resolved.
This option makes sure that if there's no built-in class in module
sources/dependencies and it is required by the front-end, the class definition
from the compiler jar will be taken instead of failing with an exception.

If both of these options are turned on, the effect is basically that compiler
built-ins are still there in the classpath, but have a lower priority than
classes explicitly declared in sources
2016-11-08 16:20:33 +03:00
Svyatoslav Scherbina 55f8257f92 build: simplify clang(++) configuration
also introduce 'execClang' block
2016-11-08 13:51:25 +07:00
Konstantin Anisimov 152e738e23 Tests for "while" and "do-while" loop generation 2016-11-08 06:35:50 +03:00
Konstantin Anisimov ea149fab4e Tests for "PLUSEQ" and "MINUSEQ" 2016-11-07 18:00:30 +03:00
Konstantin Anisimov 3c68ee4ce5 testsuite updated to reflect recent changes in codegen: branch support 2016-11-07 17:34:01 +03:00
Vasily Levchenko 147de5d3ad added .usr/bin path to tools chain to take right variants of binutils from our system archieve 2016-11-07 17:25:08 +03:00
Nikolay Igotti f06aeef9ce Some work for string concatenation. (#40) 2016-11-07 15:58:11 +03:00
Svyatoslav Scherbina 451ac00087 backend/tests: enable hello0 2016-11-07 17:42:47 +07:00
Vasily Levchenko 8880a8b7a9 disable object initialization test 2016-11-03 18:34:35 +03:00
Konstantin Anisimov 4078e4004c tests for local variables 2016-11-03 16:19:03 +03:00
Vasily Levchenko c6a5ec26d9 stash conflict occsionaly commited removed 2016-11-03 06:29:41 +03:00
Vasily Levchenko 09fb11fbc9 linux run test fix (except RTTI linking problems) 2016-11-03 06:19:26 +03:00
Svyatoslav Scherbina 58e8ed1850 backend/tests/build: fix compiler native library path 2016-11-02 17:02:14 +07:00
Svyatoslav Scherbina e7558f9ddc build: add target native SDK as downloadable dependency
also improve Gradle native toolchains configuration
2016-11-02 17:02:14 +07:00
Vasily Levchenko b3fb82da07 unwanted print 2016-11-01 21:58:02 +03:00
Vasily Levchenko ac761e0cbf unit tests and run tests are splitted
run tests can use golden value and test data to process and compare results
2016-11-01 21:49:20 +03:00
Nikolay Igotti 283303210f Rename kotlin_native -> kotlin. 2016-11-01 16:13:46 +03:00
Nikolay Igotti 7eeb2d3046 Various fixes for HelloWorld. (#27) 2016-11-01 15:33:41 +03:00
Vasily Levchenko df9bf60c30 g/c: unused vars 2016-10-31 20:56:58 +03:00
Vasily Levchenko ae3fbfcc67 g/c: line balance 2016-10-31 20:56:58 +03:00
Vasily Levchenko 90883b6ced g/c: -linq 2016-10-31 20:56:58 +03:00
Svyatoslav Scherbina 394b4ce6ec backend/build: depend on kotlin-compiler.jar from repo
instead of the jars from backend.native/kotlin-ir
2016-10-31 13:32:02 +07:00
Konstantin Anisimov f02e0af5a2 various numeric literals' tests 2016-10-28 12:27:12 +03:00
Svyatoslav Scherbina 6bfbf1050b build: compile backend.native/tests with Kotlin runtime 2016-10-27 19:32:45 +03:00
Vasily Levchenko 2690c87b9f tests depends on :runtime:build and :backend.native:build 2016-10-26 20:37:42 +03:00
Vasily Levchenko a4dd4c241a gradle replacement for Makefile in tests 2016-10-26 13:12:22 +03:00
Vasily Levchenko 64acd9d894 field acces test (when there're no storage in object for contructor parameter) (not runnable yet) 2016-10-22 09:32:48 +03:00
Vasily Levchenko 7d243378cd TEST:object initialization 2016-10-21 20:21:54 +03:00
Vasily Levchenko badcccac58 tests now can use runtime infrostructure 2016-10-20 12:34:49 +03:00
Svyatoslav Scherbina 5bb5cb70ee build: trivially support runtime sources written in Kotlin 2016-10-19 13:33:50 +03:00
Svyatoslav Scherbina 7350b4da37 backend-native: fix tests after reworking Gradle interop plugin 2016-10-19 13:33:50 +03:00
Nikolay Igotti f02339c1dc Merge pull request #4 from JetBrains/mem_mgmt
Add memory mgmt.
2016-10-11 19:10:53 +03:00
Nikolay Igotti ecb5a67db7 Add City64 as local hash, and update RTTI accordingly. 2016-10-11 18:40:16 +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