From 1e87dfeb8bee785c1762552a4c8302b6e5e4442d Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Fri, 18 Nov 2016 20:43:13 +0300 Subject: [PATCH] link test --- backend.native/tests/build.gradle | 5 ++--- backend.native/tests/link/lib/foo.kt | 7 +++++++ backend.native/tests/link/lib/foo2.kt | 7 +++++++ backend.native/tests/link/src/bar.kt | 5 +++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 backend.native/tests/link/lib/foo.kt create mode 100644 backend.native/tests/link/lib/foo2.kt create mode 100644 backend.native/tests/link/src/bar.kt diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index 2adbdc100f3..bd489e0ea6f 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -142,7 +142,7 @@ class LinkKonanTest extends KonanTest { private File dir2bc(String ktSources) { def sourcesKt = project.file(ktSources) - def libBc = new File("${sourcesKt.absolutePath}/bc/libout.kt.bc") + def libBc = new File("${sourcesKt.absolutePath}/libout.kt.bc") def libPath = "${libBc.absolutePath}" project.javaexec { @@ -367,11 +367,10 @@ task intrinsic(type: UnitKonanTest) { source = "codegen/function/intrinsic.kt" } -/* TODO: fix test task link(type: LinkKonanTest) { source = "link/src/bar.kt" lib = "link/lib" -} */ +} task for0(type: RunKonanTest) { goldValue = "2\n3\n4\n" diff --git a/backend.native/tests/link/lib/foo.kt b/backend.native/tests/link/lib/foo.kt new file mode 100644 index 00000000000..5cc216de0ff --- /dev/null +++ b/backend.native/tests/link/lib/foo.kt @@ -0,0 +1,7 @@ +package qwerty + +fun foo(a: Int): Int { + return a +} + + diff --git a/backend.native/tests/link/lib/foo2.kt b/backend.native/tests/link/lib/foo2.kt new file mode 100644 index 00000000000..500844ccda2 --- /dev/null +++ b/backend.native/tests/link/lib/foo2.kt @@ -0,0 +1,7 @@ +package qwerty + +fun foo2(a: Int): Int { + return a +} + + diff --git a/backend.native/tests/link/src/bar.kt b/backend.native/tests/link/src/bar.kt new file mode 100644 index 00000000000..3ed2cbacd98 --- /dev/null +++ b/backend.native/tests/link/src/bar.kt @@ -0,0 +1,5 @@ +package qwerty + +fun bar(a: Int): Int { + return foo(foo2(a)) +}