diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index ea22c752e2b..2f67d8245dc 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -399,20 +399,12 @@ task fields(type: KonanLocalTest) { source = "codegen/object/fields.kt" } - task fields1(type: KonanLocalTest) { source = "codegen/object/fields1.kt" } task fields2(type: KonanLocalTest) { - goldValue = - "Set global = 1\n" + - "Set member = 42\n" + - "Get member = 42\n" + - "Set global = 42\n" + - "Get global = 42\n" + - "Set member = 42\n" - + useGoldenData = true source = "codegen/object/fields2.kt" } @@ -427,7 +419,7 @@ task objectInitialization(type: KonanLocalTest) { } task objectInitialization1(type: KonanLocalTest) { - goldValue = "init\nfield\nconstructor1\ninit\nfield\nconstructor1\nconstructor2\n" + useGoldenData = true source = "codegen/object/initialization1.kt" } @@ -436,18 +428,17 @@ standaloneTest("object_globalInitializer") { } task check_type(type: KonanLocalTest) { - goldValue = "true\nfalse\ntrue\ntrue\ntrue\ntrue\n" + useGoldenData = true source = "codegen/basics/check_type.kt" } task safe_cast(type: KonanLocalTest) { - goldValue = "safe_cast_positive: true\n" + - "safe_cast_negative: true\n" + useGoldenData = true source = "codegen/basics/safe_cast.kt" } task typealias1(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/basics/typealias1.kt" } @@ -492,52 +483,52 @@ task function_defaults3(type: KonanLocalTest) { } task function_defaults4(type: KonanLocalTest) { - goldValue = "43\n" + useGoldenData = true source = "codegen/function/defaults4.kt" } task function_defaults5(type: KonanLocalTest) { - goldValue = "5\n6\n" + useGoldenData = true source = "codegen/function/defaults5.kt" } task function_defaults6(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/function/defaults6.kt" } task function_defaults7(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/function/defaults7.kt" } task function_defaults8(type: KonanLocalTest) { - goldValue = "2\n" + useGoldenData = true source = "codegen/function/defaults8.kt" } task function_defaults9(type: KonanLocalTest) { - goldValue = "1\n" + useGoldenData = true source = "codegen/function/defaults9.kt" } task function_defaults10(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/function/defaults10.kt" } task function_defaults_from_fake_override(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/function/defaultsFromFakeOverride.kt" } task function_defaults_with_vararg1(type: KonanLocalTest) { - goldValue = "Hello , Correct!\nHello World, Correct!\n , Correct!\n" + useGoldenData = true source = "codegen/function/defaultsWithVarArg1.kt" } task function_defaults_with_vararg2(type: KonanLocalTest) { - goldValue = "1\n2\n42\n" + useGoldenData = true source = "codegen/function/defaultsWithVarArg2.kt" } @@ -557,105 +548,88 @@ standaloneTest("function_nothingN_returning_safe_call") { standaloneTest("unreachable_statement_after_return") { flags = ["-g", "-entry", "codegen.function.unreachable_statement_after_return.main"] source = "codegen/function/unreachableStatementAfterReturn.kt" - goldValue = "1\n2\n3\n4\n" + useGoldenData = true } task codegen_controlflow_for_loops(type: KonanLocalTest) { source = "codegen/controlflow/for_loops.kt" - goldValue = "01234\n0123\n43210\n\n024\n02\n420\n\n036\n03\n630\n\n024\n02\n420\n\n" + useGoldenData = true } task codegen_controlflow_for_loops_types(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_types.kt" - goldValue = "01234\n01234\n01234\n01234\n01234\n01234\n01234\n01234\n01234\n01234\n01234\n01234\n01234\n01234\n" + - "01234\n01234\n0123\n0123\n0123\n0123\n0123\n0123\n0123\n0123\n0123\n0123\n0123\n0123\n0123\n0123\n0123\n" + - "0123\n43210\n43210\n43210\n43210\n43210\n43210\n43210\n43210\n43210\n43210\n43210\n43210\n43210\n43210\n" + - "43210\n43210\nabcd\nabc\ndcba\n024\n024\n024\n024\n024\n024\n024\n024\n024\n024\n024\n024\n024\n024\n" + - "024\n024\n02\n02\n02\n02\n02\n02\n02\n02\n02\n02\n02\n02\n02\n02\n02\n02\n420\n420\n420\n420\n420\n420\n" + - "420\n420\n420\n420\n420\n420\n420\n420\n420\n420\nac\nac\ndb\n" + useGoldenData = true } task codegen_controlflow_for_loops_overflow(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_overflow.kt" - goldValue = "2147483646 2147483647 \n2147483646 \n-2147483647 -2147483648 \n1073741827 \n" + useGoldenData = true } task codegen_controlflow_for_loops_errors(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Uses exceptions. source = "codegen/controlflow/for_loops_errors.kt" - goldValue = "OK\n" + useGoldenData = true } task codegen_controlflow_for_loops_empty_range(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_empty_range.kt" - goldValue = "OK\n" + useGoldenData = true } task codegen_controlflow_for_loops_nested(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_nested.kt" - goldValue = "00 01 02 10 11 12 20 21 22 \n" + - "00 01 10 11 20 21 \n" + - "00 01 10 11 20 21 \n" + - "00 01 \n" + - "00 02 10 12 20 22 \n" + - "00 02 10 12 20 22 \n" + - "00 10 20 \n" + useGoldenData = true } task codegen_controlflow_for_loops_coroutines(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_coroutines.kt" - goldValue = "before: 0 after: 0\n" + - "before: 2 after: 2\n" + - "before: 4 after: 4\n" + - "before: 6 after: 6\n" + - "Got: 0 2 4 6\n" + useGoldenData = true } task codegen_controlflow_for_loops_let_with_nullable(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_let_with_nullable.kt" - goldValue = "012345\n012345\n024\n01234\n01234\n024\n543210\n543210\n531\n" + - "012345\n012345\n024\n01234\n01234\n024\n543210\n543210\n531\n" + - "abcdef\nabcdef\nace\nabcde\nabcde\nace\nfedcba\nfedcba\nfdb\n" + useGoldenData = true } task codegen_controlflow_for_loops_call_order(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_call_order.kt" - goldValue = "1234\n1234\n2134\n" + useGoldenData = true } task codegen_controlflow_for_loops_array_indices(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_array_indices.kt" - goldValue = "0123\n\n" + useGoldenData = true } task codegen_controlflow_for_loops_array(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_array.kt" - goldValue = "4035\n\n0\n0\n" + useGoldenData = true } task codegen_controlflow_for_loops_array_nested(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_array_nested.kt" - goldValue = "123\nHello\n\n12345678910\n" + useGoldenData = true } task codegen_controlflow_for_loops_array_side_effects(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_array_side_effects.kt" - goldValue = "side-effect\n4035\nside-effect\n\n" + useGoldenData = true } task codegen_controlflow_for_loops_array_break_continue(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_array_break_continue.kt" - goldValue = "403\n\n" + useGoldenData = true } task codegen_controlflow_for_loops_array_mutation(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_array_mutation.kt" - goldValue = "4000" + useGoldenData = true } task codegen_controlflow_for_loops_array_nullable(type: KonanLocalTest) { source = "codegen/controlflow/for_loops_array_nullable.kt" - goldValue = "123" + useGoldenData = true } task local_variable(type: KonanLocalTest) { @@ -663,7 +637,7 @@ task local_variable(type: KonanLocalTest) { } task canonical_name(type: KonanLocalTest) { - goldValue = "A:foo\nA:qux\n" + useGoldenData = true source = "codegen/basics/canonical_name.kt" } @@ -673,30 +647,30 @@ task cast_simple(type: KonanLocalTest) { task cast_null(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "Ok\n" + useGoldenData = true source = "codegen/basics/cast_null.kt" } task unchecked_cast1(type: KonanLocalTest) { - goldValue = "17\n17\n42\n42\n" + useGoldenData = true source = "codegen/basics/unchecked_cast1.kt" } task unchecked_cast2(type: KonanLocalTest) { enabled = false - goldValue = "Ok\n" + useGoldenData = true source = "codegen/basics/unchecked_cast2.kt" } task unchecked_cast3(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "Ok\n" + useGoldenData = true source = "codegen/basics/unchecked_cast3.kt" } task unchecked_cast4(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "Ok\n" + useGoldenData = true source = "codegen/basics/unchecked_cast4.kt" } @@ -733,7 +707,7 @@ task runtime_worker_random(type: KonanLocalTest) { } task hello0(type: KonanLocalTest) { - goldValue = "Hello, world!\n" + useGoldenData = true source = "runtime/basic/hello0.kt" } @@ -742,97 +716,92 @@ task stringTrim(type: KonanLocalTest) { } standaloneTest("hello1") { - goldValue = "Hello World" + useGoldenData = true testData = "Hello World\n" source = "runtime/basic/hello1.kt" } standaloneTest("hello2") { - goldValue = "you entered 'Hello World'" + useGoldenData = true testData = "Hello World\n" source = "runtime/basic/hello2.kt" } task hello3(type: KonanLocalTest) { - goldValue = "239\ntrue\n3.14159\nA\n" + useGoldenData = true source = "runtime/basic/hello3.kt" } task hello4(type: KonanLocalTest) { - goldValue = "Hello\nПока\n" + useGoldenData = true source = "runtime/basic/hello4.kt" } standaloneTest('enumEquals') { - goldValue = "true\nfalse\nfalse\n" + useGoldenData = true source = "runtime/basic/enum_equals.kt" flags = ['-XXLanguage:-ProhibitComparisonOfIncompatibleEnums', '-e', 'runtime.basic.enum_equals.main'] } standaloneTest("entry0") { - goldValue = "Hello.\n" + useGoldenData = true source = "runtime/basic/entry0.kt" flags = ["-entry", "runtime.basic.entry0.main"] } standaloneTest("entry1") { - goldValue = "Hello.\n" + useGoldenData = true source = "runtime/basic/entry1.kt" flags = ["-entry", "foo"] } linkTest("entry2") { - goldValue = "Hello.\n" + useGoldenData = true source = "runtime/basic/entry2.kt" lib = "runtime/basic/libentry2.kt" flags = ["-entry", "foo"] } standaloneTest("entry3") { - goldValue = "Hello, without args.\n" - source = "runtime/basic/entry1.kt" + useGoldenData = true + source = "runtime/basic/entry3.kt" flags = ["-entry", "bar"] } standaloneTest("entry4") { - goldValue = "This is main without args\n" + useGoldenData = true source = "runtime/basic/entry4.kt" } standaloneTest("readline0") { - goldValue = "41" + useGoldenData = true testData = "41\r\n" source = "runtime/basic/readline0.kt" } standaloneTest("readline1") { - goldValue = "" + useGoldenData = true testData = "\n" source = "runtime/basic/readline1.kt" } task tostring0(type: KonanLocalTest) { - goldValue = "127\n-1\n239\nA\nЁ\nト\n1122334455\n112233445566778899\n3.14159265358\n1.0E27\n1.0E7\n1.0E-300\ntrue\nfalse\n" + useGoldenData = true source = "runtime/basic/tostring0.kt" } task tostring1(type: KonanLocalTest) { - goldValue = "ello\n" + useGoldenData = true source = "runtime/basic/tostring1.kt" } task tostring2(type: KonanLocalTest) { - goldValue = "H e l l o \nHello\n" + useGoldenData = true source = "runtime/basic/tostring2.kt" } task tostring3(type: KonanLocalTest) { - goldValue = "-128\n127\n-32768\n32767\n" + - "-2147483648\n2147483647\n-9223372036854775808\n9223372036854775807\n" + - "1.4E-45\n3.4028235E38\n-Infinity\nInfinity\n" + - "NaN\n" + - "4.9E-324\n1.7976931348623157E308\n-Infinity\nInfinity\n" + - "NaN\n" + useGoldenData = true source = "runtime/basic/tostring3.kt" } @@ -841,7 +810,7 @@ task tostring4(type: KonanLocalTest) { } task empty_substring(type: KonanLocalTest) { - goldValue = "\n" + useGoldenData = true source = "runtime/basic/empty_substring.kt" } @@ -863,19 +832,19 @@ standaloneTest("cleaner_in_main_with_checker") { enabled = (project.testTarget != 'wasm32') && // Cleaners need workers !isNoopGC source = "runtime/basic/cleaner_in_main_with_checker.kt" - goldValue = "42\n" + useGoldenData = true } standaloneTest("cleaner_in_main_without_checker") { enabled = (project.testTarget != 'wasm32') // Cleaners need workers source = "runtime/basic/cleaner_in_main_without_checker.kt" - goldValue = "" + useGoldenData = true } standaloneTest("cleaner_leak_without_checker") { enabled = (project.testTarget != 'wasm32') // Cleaners need workers source = "runtime/basic/cleaner_leak_without_checker.kt" - goldValue = "" + useGoldenData = true } standaloneTest("cleaner_leak_with_checker") { @@ -926,79 +895,83 @@ standaloneTest("worker_bound_reference0") { task worker0(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "Got Input processed\nOK\n" + useGoldenData = true source = "runtime/workers/worker0.kt" } task worker1(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/worker1.kt" } task worker2(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/worker2.kt" } task worker3(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/worker3.kt" } task worker4(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "Got 42\nOK\n" + useGoldenData = true source = "runtime/workers/worker4.kt" } // This tests changes main thread worker queue state, so better be executed alone. standaloneTest("worker5") { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "Got 3\nOK\n" + useGoldenData = true source = "runtime/workers/worker5.kt" } task worker6(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "Got 42\nOK\n" + useGoldenData = true source = "runtime/workers/worker6.kt" } task worker7(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "Input\nGot kotlin.Unit\nOK\n" + useGoldenData = true source = "runtime/workers/worker7.kt" } task worker8(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "SharedData(string=Hello, int=10, member=SharedDataMember(double=0.1))\nGot kotlin.Unit\nOK\n" + useGoldenData = true source = "runtime/workers/worker8.kt" } task worker9(type: KonanLocalTest) { - enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - if (isExperimentalMM) { - goldValue = "zzz\n42\nOK\nfirst 2\nsecond 3\nunfrozen OK\nfrozen OK\n" - } else { - goldValue = "zzz\n42\nOK\nfirst 2\nsecond 3\nfrozen OK\n" - } + enabled = (project.testTarget != 'wasm32') && // Workers need pthreads. + !isExperimentalMM + useGoldenData = true source = "runtime/workers/worker9.kt" } +task worker9_experimentalMM(type: KonanLocalTest) { + enabled = (project.testTarget != 'wasm32') && // Workers need pthreads. + isExperimentalMM + useGoldenData = true + source = "runtime/workers/worker9_experimentalMM.kt" +} + task worker10(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') && // Workers need pthreads. !isNoopGC - goldValue = "OK\ntrue\ntrue\n" + useGoldenData = true source = "runtime/workers/worker10.kt" } task worker11(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/worker11.kt" } @@ -1106,60 +1079,55 @@ standaloneTest("worker_threadlocal_no_leak") { task freeze0(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // No workers on WASM. - goldValue = "frozen bit is true\n" + - "Worker: SharedData(string=Hello, int=10, member=SharedDataMember(double=0.1))\n" + - "Main: SharedData(string=Hello, int=10, member=SharedDataMember(double=0.1))\n" + - "OK\n" + useGoldenData = true source = "runtime/workers/freeze0.kt" } task freeze1(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // No exceptions on WASM. - goldValue = "OK, cannot mutate frozen\n" + useGoldenData = true source = "runtime/workers/freeze1.kt" } task freeze_stress(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // No exceptions on WASM. - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/freeze_stress.kt" } task freeze2(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // No exceptions on WASM. - goldValue = - "Worker 1: Hello world\n" + "Worker2: 42\n" + - "Worker3: 239.0\n" + "Worker4: a\n" + "OK\n" + useGoldenData = true source = "runtime/workers/freeze2.kt" } task freeze3(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // No exceptions on WASM. - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/freeze3.kt" } task freeze4(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // No exceptions on WASM. - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/freeze4.kt" } task freeze5(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/freeze5.kt" } task freeze6(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') && // No exceptions on WASM. !isNoopGC - goldValue = "OK\nOK\n" + useGoldenData = true source = "runtime/workers/freeze6.kt" } task atomic0(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "35\n" + "20\n" + "OK\n" + useGoldenData = true source = "runtime/workers/atomic0.kt" } @@ -1171,18 +1139,18 @@ standaloneTest("atomic1") { task lazy0(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/lazy0.kt" } task lazy1(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Need exceptions. - goldValue = "OK\n" + useGoldenData = true source = "runtime/workers/lazy1.kt" } standaloneTest("lazy2") { - goldValue = "123\nOK\n" + useGoldenData = true source = "runtime/workers/lazy2.kt" } @@ -1203,7 +1171,7 @@ task mutableData1(type: KonanLocalTest) { task enumIdentity(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // Workers need pthreads. - goldValue = "true\n" + useGoldenData = true source = "runtime/workers/enum_identity.kt" } @@ -1225,78 +1193,78 @@ standaloneTest("leakMemoryWithWorkerTermination") { } task superFunCall(type: KonanLocalTest) { - goldValue = "\n\n" + useGoldenData = true source = "codegen/basics/superFunCall.kt" } task superGetterCall(type: KonanLocalTest) { - goldValue = "\n\n" + useGoldenData = true source = "codegen/basics/superGetterCall.kt" } task superSetterCall(type: KonanLocalTest) { - goldValue = "zzz\nzzz\n" + useGoldenData = true source = "codegen/basics/superSetterCall.kt" } task enum0(type: KonanLocalTest) { - goldValue = "VALUE\n" + useGoldenData = true source = "codegen/enum/test0.kt" } task enum1(type: KonanLocalTest) { - goldValue = "z12\n" + useGoldenData = true source = "codegen/enum/test1.kt" } task enum_valueOf(type: KonanLocalTest) { - goldValue = "E1\nE2\nE3\nE1\nE2\nE3\n" + useGoldenData = true source = "codegen/enum/valueOf.kt" } task enum_values(type: KonanLocalTest) { - goldValue = "E3\nE1\nE2\nE3\nE1\nE2\n" + useGoldenData = true source = "codegen/enum/values.kt" } task enum_vCallNoEntryClass(type: KonanLocalTest) { - goldValue = "('z3', 3)\n" + useGoldenData = true source = "codegen/enum/vCallNoEntryClass.kt" } task enum_vCallWithEntryClass(type: KonanLocalTest) { - goldValue = "z1z2\n" + useGoldenData = true source = "codegen/enum/vCallWithEntryClass.kt" } task enum_companionObject(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/enum/companionObject.kt" } task enum_interfaceCallNoEntryClass(type: KonanLocalTest) { - goldValue = "('z3', 3)\n('z3', 3)\n" + useGoldenData = true source = "codegen/enum/interfaceCallNoEntryClass.kt" } task enum_interfaceCallWithEntryClass(type: KonanLocalTest) { - goldValue = "z1z2\nz1z2\n" + useGoldenData = true source = "codegen/enum/interfaceCallWithEntryClass.kt" } linkTest("enum_linkTest") { - goldValue = "42\n117\n-1\n" + useGoldenData = true source = "codegen/enum/linkTest_main.kt" lib = "codegen/enum/linkTest_lib.kt" } task enum_varargParam(type: KonanLocalTest) { - goldValue = "3\n" + useGoldenData = true source = "codegen/enum/varargParam.kt" } task enum_nested(type: KonanLocalTest) { - goldValue = "A\nC\n" + useGoldenData = true source = "codegen/enum/nested.kt" } @@ -1306,7 +1274,7 @@ task enum_isFrozen(type: KonanLocalTest) { } task enum_loop(type: KonanLocalTest) { - goldValue = "Z\nZ\n" + useGoldenData = true source = "codegen/enum/loop.kt" } @@ -1315,68 +1283,59 @@ task enum_reorderedArguments(type: KonanLocalTest) { } standaloneTest('switchLowering') { - goldValue = "EnumA.A\nok\nok\nok\nok\nok\n" + useGoldenData = true source = "codegen/enum/switchLowering.kt" flags = ['-XXLanguage:-ProhibitComparisonOfIncompatibleEnums', '-e', 'codegen.enum.switchLowering.main'] } task enum_lambdaInDefault(type: KonanLocalTest) { - goldValue = "Q\n" + useGoldenData = true source = "codegen/enum/lambdaInDefault.kt" } linkTest("mangling") { - goldValue = - "Int direct [1, 2, 3, 4]\n" + - "out Number direct [9, 10, 11, 12]\n" + - "star direct [5, 6, 7, 8]\n" + - "Int param [1, 2, 3, 4]\n" + - "out Number param [9, 10, 11, 12]\n" + - "star param [5, 6, 7, 8]\n" + - "no constructors {}\n" + - "single constructor some string\n" + - "two constructors 17\n" + useGoldenData = true source = "mangling/mangling.kt" lib = "mangling/manglinglib.kt" } task innerClass_simple(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/innerClass/simple.kt" } task innerClass_getOuterVal(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/innerClass/getOuterVal.kt" } task innerClass_generic(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/innerClass/generic.kt" } task innerClass_doubleInner(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/innerClass/doubleInner.kt" } task innerClass_qualifiedThis(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/innerClass/qualifiedThis.kt" } task innerClass_superOuter(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/innerClass/superOuter.kt" } task innerClass_noPrimaryConstructor(type: KonanLocalTest) { - goldValue = "OK\nOK\n" + useGoldenData = true source = "codegen/innerClass/noPrimaryConstructor.kt" } task innerClass_secondaryConstructor(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/innerClass/secondaryConstructor.kt" } @@ -1386,7 +1345,7 @@ linkTest("innerClass_linkTest") { } task localClass_localHierarchy(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/localClass/localHierarchy.kt" } @@ -1402,78 +1361,78 @@ task object_isFrozen(type: KonanLocalTest) { } task localClass_objectExpressionInProperty(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/localClass/objectExpressionInProperty.kt" } task localClass_objectExpressionInInitializer(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/localClass/objectExpressionInInitializer.kt" } task localClass_innerWithCapture(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/localClass/innerWithCapture.kt" } task localClass_innerTakesCapturedFromOuter(type: KonanLocalTest) { - goldValue = "0\n1\n" + useGoldenData = true source = "codegen/localClass/innerTakesCapturedFromOuter.kt" } task localClass_virtualCallFromConstructor(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/localClass/virtualCallFromConstructor.kt" } task localClass_noPrimaryConstructor(type: KonanLocalTest) { - goldValue = "OKOK\n" + useGoldenData = true source = "codegen/localClass/noPrimaryConstructor.kt" } task localClass_localFunctionCallFromLocalClass(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/localClass/localFunctionCallFromLocalClass.kt" } task localClass_localFunctionInLocalClass(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/localClass/localFunctionInLocalClass.kt" } task localClass_tryCatch(type: KonanLocalTest) { - goldValue = "" + useGoldenData = true source = "codegen/localClass/tryCatch.kt" } task function_localFunction(type : KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/function/localFunction.kt" } task function_localFunction2(type : KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/function/localFunction2.kt" } task function_localFunction3(type : KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/function/localFunction3.kt" } task initializers_correctOrder1(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/initializers/correctOrder1.kt" } task initializers_correctOrder2(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/initializers/correctOrder2.kt" } standaloneTest("initializers_correctOrder3") { source = "codegen/initializers/correctOrder3.kt" - goldValue = "3\n" + useGoldenData = true } standaloneTest("initializers_globalInitedAfterAccessingFile") { @@ -1512,98 +1471,98 @@ standaloneTest("initializers_eagerInitializationThreadLocal2") { standaloneTest("initializers_workers1") { expectedFail = (project.testTarget == 'wasm32') // Workers are not supported source = "codegen/initializers/workers1.kt" - goldValue = "42\n3\n" + useGoldenData = true } standaloneTest("initializers_workers2") { expectedFail = (project.testTarget == 'wasm32') // Workers are not supported source = "codegen/initializers/workers2.kt" - goldValue = "42\n42\n" + useGoldenData = true } standaloneTest("initializers_failInInitializer1") { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. source = "codegen/initializers/failInInitializer1.kt" - goldValue = "caught\n" + useGoldenData = true flags = ['-Xir-property-lazy-initialization=enable'] } standaloneTest("initializers_failInInitializer2") { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. source = "codegen/initializers/failInInitializer2.kt" - goldValue = "caught\ncaught2\n" + useGoldenData = true flags = ['-Xir-property-lazy-initialization=enable'] } standaloneTest("initializers_failInInitializer3") { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. source = "codegen/initializers/failInInitializer3.kt" - goldValue = "caught\ncaught2\n" + useGoldenData = true flags = ['-Xir-property-lazy-initialization=enable'] } standaloneTest("initializers_failInInitializer4") { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. source = "codegen/initializers/failInInitializer4.kt" - goldValue = "caught\ncaught2\n" + useGoldenData = true flags = ['-Xir-property-lazy-initialization=enable'] } standaloneTest("initializers_when1") { source = "codegen/initializers/when1.kt" - goldValue = "42\n" + useGoldenData = true } standaloneTest("initializers_when2") { source = "codegen/initializers/when2.kt" - goldValue = "42\n" + useGoldenData = true } standaloneTest("initializers_throw1") { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. source = "codegen/initializers/throw1.kt" - goldValue = "42\n" + useGoldenData = true } standaloneTest("initializers_throw2") { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. source = "codegen/initializers/throw2.kt" - goldValue = "42\n" + useGoldenData = true } standaloneTest("initializers_while1") { source = "codegen/initializers/while1.kt" - goldValue = "42\n" + useGoldenData = true } standaloneTest("initializers_while2") { source = "codegen/initializers/while2.kt" - goldValue = "42\n" + useGoldenData = true } standaloneTest("initializers_while3") { source = "codegen/initializers/while3.kt" - goldValue = "42\n" + useGoldenData = true } standaloneTest("initializers_return1") { source = "codegen/initializers/return1.kt" - goldValue = "42\n" + useGoldenData = true } standaloneTest("initializers_return2") { source = "codegen/initializers/return2.kt" - goldValue = "42\n" + useGoldenData = true } linkTest("initializers_linkTest1") { - goldValue = "1200\n" + useGoldenData = true source = "codegen/initializers/linkTest1_main.kt" lib = "codegen/initializers/linkTest1_lib.kt" } linkTest("initializers_linkTest2") { - goldValue = "2\n" + useGoldenData = true source = "codegen/initializers/linkTest2_main.kt" lib = "codegen/initializers/linkTest2_lib.kt" } @@ -1627,114 +1586,114 @@ task arithmetic_github1856(type: KonanLocalTest) { } task bridges_test0(type: KonanLocalTest) { - goldValue = "42\n42\n" + useGoldenData = true source = "codegen/bridges/test0.kt" } task bridges_test1(type: KonanLocalTest) { - goldValue = "1042\n" + useGoldenData = true source = "codegen/bridges/test1.kt" } task bridges_test2(type: KonanLocalTest) { - goldValue = "42\n42\n" + useGoldenData = true source = "codegen/bridges/test2.kt" } task bridges_test3(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/bridges/test3.kt" } task bridges_test4(type: KonanLocalTest) { - goldValue = "42\n42\n" + useGoldenData = true source = "codegen/bridges/test4.kt" } task bridges_test5(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/bridges/test5.kt" } task bridges_test6(type: KonanLocalTest) { - goldValue = "42\n42\n42\n42\n42\n" + useGoldenData = true source = "codegen/bridges/test6.kt" } task bridges_test7(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/bridges/test7.kt" } task bridges_test8(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/bridges/test8.kt" } task bridges_test9(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/bridges/test9.kt" } task bridges_test10(type: KonanLocalTest) { - goldValue = "42\n42\n" + useGoldenData = true source = "codegen/bridges/test10.kt" } task bridges_test11(type: KonanLocalTest) { - goldValue = "42\n42\n42\n" + useGoldenData = true source = "codegen/bridges/test11.kt" } task bridges_test12(type: KonanLocalTest) { - goldValue = "B: 42\nC: 42\n" + useGoldenData = true source = "codegen/bridges/test12.kt" } task bridges_test13(type: KonanLocalTest) { - goldValue = "42\n42\n" + useGoldenData = true source = "codegen/bridges/test13.kt" } task bridges_test14(type: KonanLocalTest) { - goldValue = "42\n56\n42\n56\n56\n42\n156\n142\n" + useGoldenData = true source = "codegen/bridges/test14.kt" } task bridges_test15(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/bridges/test15.kt" } task bridges_test16(type: KonanLocalTest) { - goldValue = "OK\nOK\n" + useGoldenData = true source = "codegen/bridges/test16.kt" } task bridges_test17(type: KonanLocalTest) { - goldValue = "42\n42\n42\n42\n" + useGoldenData = true source = "codegen/bridges/test17.kt" } task bridges_test18(type: KonanLocalTest) { - goldValue = "kotlin.Unit\n" + useGoldenData = true source = "codegen/bridges/test18.kt" } linkTest("bridges_linkTest") { - goldValue = "42\n42\n42\n" + useGoldenData = true source = "codegen/bridges/linkTest_main.kt" lib = "codegen/bridges/linkTest_lib.kt" } linkTest("bridges_linkTest2") { - goldValue = "true\n" + useGoldenData = true source = "codegen/bridges/linkTest2_main.kt" lib = "codegen/bridges/linkTest2_lib.kt" } task bridges_special(type: KonanLocalTest) { - goldValue = "Ok\n" + useGoldenData = true source = "codegen/bridges/special.kt" } @@ -1751,27 +1710,27 @@ task returnTypeSignature(type: KonanLocalTest) { } task classDelegation_method(type: KonanLocalTest) { - goldValue = "OKOK\n" + useGoldenData = true source = "codegen/classDelegation/method.kt" } task classDelegation_property(type: KonanLocalTest) { - goldValue = "4242\n" + useGoldenData = true source = "codegen/classDelegation/property.kt" } task classDelegation_generic(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/classDelegation/generic.kt" } task classDelegation_withBridge(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/classDelegation/withBridge.kt" } linkTest("classDelegation_linkTest") { - goldValue = "qxx\n123\n42\n117\nzzz\n" + useGoldenData = true source = "codegen/classDelegation/linkTest_main.kt" lib = "codegen/classDelegation/linkTest_lib.kt" } @@ -1782,143 +1741,143 @@ standaloneTest("contracts") { } task delegatedProperty_simpleVal(type: KonanLocalTest) { - goldValue = "x\n42\n" + useGoldenData = true source = "codegen/delegatedProperty/simpleVal.kt" } task delegatedProperty_simpleVar(type: KonanLocalTest) { - goldValue = "get x\n42\nset x\nget x\n117\n" + useGoldenData = true source = "codegen/delegatedProperty/simpleVar.kt" } task delegatedProperty_packageLevel(type: KonanLocalTest) { - goldValue = "x\n42\n" + useGoldenData = true source = "codegen/delegatedProperty/packageLevel.kt" } task delegatedProperty_local(type: KonanLocalTest) { - goldValue = "x\n42\n" + useGoldenData = true source = "codegen/delegatedProperty/local.kt" } linkTest("delegatedProperty_delegatedOverride") { - goldValue = "156\nx\n117\n42\n" + useGoldenData = true source = "codegen/delegatedProperty/delegatedOverride_main.kt" lib = "codegen/delegatedProperty/delegatedOverride_lib.kt" } linkTest("delegatedProperty_correctFieldsOrder") { - goldValue = "qxx\n117\nzzz\nqzz\n" + useGoldenData = true source = "codegen/delegatedProperty/correctFieldsOrder_main.kt" lib = "codegen/delegatedProperty/correctFieldsOrder_lib.kt" } task delegatedProperty_lazy(type: KonanLocalTest) { - goldValue = "computed!\nHello\nHello\n" + useGoldenData = true source = "codegen/delegatedProperty/lazy.kt" } task delegatedProperty_observable(type: KonanLocalTest) { - goldValue = " -> first\nfirst -> second\n" + useGoldenData = true source = "codegen/delegatedProperty/observable.kt" } task delegatedProperty_map(type: KonanLocalTest) { - goldValue = "John Doe\n25\n" + useGoldenData = true source = "codegen/delegatedProperty/map.kt" } task propertyCallableReference_valClass(type: KonanLocalTest) { - goldValue = "42\n117\n" + useGoldenData = true source = "codegen/propertyCallableReference/valClass.kt" } task propertyCallableReference_valModule(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/propertyCallableReference/valModule.kt" } task propertyCallableReference_varClass(type: KonanLocalTest) { - goldValue = "117\n117\n42\n42\n" + useGoldenData = true source = "codegen/propertyCallableReference/varClass.kt" } task propertyCallableReference_varModule(type: KonanLocalTest) { - goldValue = "117\n117\n" + useGoldenData = true source = "codegen/propertyCallableReference/varModule.kt" } task propertyCallableReference_valExtension(type: KonanLocalTest) { - goldValue = "42\n117\n" + useGoldenData = true source = "codegen/propertyCallableReference/valExtension.kt" } task propertyCallableReference_varExtension(type: KonanLocalTest) { - goldValue = "117\n117\n42\n42\n" + useGoldenData = true source = "codegen/propertyCallableReference/varExtension.kt" } linkTest("propertyCallableReference_linkTest") { - goldValue = "42\n117\n" + useGoldenData = true source = "codegen/propertyCallableReference/linkTest_main.kt" lib = "codegen/propertyCallableReference/linkTest_lib.kt" } task propertyCallableReference_dynamicReceiver(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/propertyCallableReference/dynamicReceiver.kt" } task lateinit_initialized(type: KonanLocalTest) { - goldValue = "zzz\n" + useGoldenData = true source = "codegen/lateinit/initialized.kt" } task lateinit_notInitialized(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "OK\n" + useGoldenData = true source = "codegen/lateinit/notInitialized.kt" } task lateinit_inBaseClass(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/lateinit/inBaseClass.kt" } task lateinit_localInitialized(type: KonanLocalTest) { - goldValue = "zzz\n" + useGoldenData = true source = "codegen/lateinit/localInitialized.kt" } task lateinit_localNotInitialized(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "OK\n" + useGoldenData = true source = "codegen/lateinit/localNotInitialized.kt" } task lateinit_localCapturedInitialized(type: KonanLocalTest) { - goldValue = "zzz\n" + useGoldenData = true source = "codegen/lateinit/localCapturedInitialized.kt" } task lateinit_localCapturedNotInitialized(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "OK\n" + useGoldenData = true source = "codegen/lateinit/localCapturedNotInitialized.kt" } task lateinit_isInitialized(type: KonanLocalTest) { - goldValue = "false\ntrue\n" + useGoldenData = true source = "codegen/lateinit/isInitialized.kt" } task lateinit_globalIsInitialized(type: KonanLocalTest) { - goldValue = "false\ntrue\n" + useGoldenData = true source = "codegen/lateinit/globalIsInitialized.kt" } task lateinit_innerIsInitialized(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/lateinit/innerIsInitialized.kt" } @@ -1931,12 +1890,12 @@ task kclass0(type: KonanLocalTest) { } task kclass1(type: KonanLocalTest) { - goldValue = "OK :D\n" + useGoldenData = true source = "codegen/kclass/kclass1.kt" } task kclassEnumArgument(type: KonanLocalTest) { - goldValue = "String\n" + useGoldenData = true source = "codegen/kclass/kClassEnumArgument.kt" } @@ -1953,27 +1912,27 @@ task associatedObjects1(type: KonanLocalTest) { } task coroutines_simple(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/coroutines/simple.kt" } task coroutines_degenerate1(type: KonanLocalTest) { - goldValue = "s1\n" + useGoldenData = true source = "codegen/coroutines/degenerate1.kt" } task coroutines_degenerate2(type: KonanLocalTest) { - goldValue = "s2\ns1\n" + useGoldenData = true source = "codegen/coroutines/degenerate2.kt" } task coroutines_withReceiver(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/coroutines/withReceiver.kt" } task coroutines_correctOrder1(type: KonanLocalTest) { - goldValue = "f1\ns1\nf2\n160\n" + useGoldenData = true source = "codegen/coroutines/correctOrder1.kt" } @@ -1982,158 +1941,158 @@ task coroutines_controlFlow_chain(type: KonanLocalTest) { } task coroutines_controlFlow_if1(type: KonanLocalTest) { - goldValue = "f1\ns1\nf3\n84\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_if1.kt" } task coroutines_controlFlow_if2(type: KonanLocalTest) { - goldValue = "f1\ns1\nf2\n43\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_if2.kt" } task coroutines_controlFlow_finally1(type: KonanLocalTest) { - goldValue = "f1\ns1\n117\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_finally1.kt" } task coroutines_controlFlow_finally2(type: KonanLocalTest) { - goldValue = "f1\ns1\n117\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_finally2.kt" } task coroutines_controlFlow_finally3(type: KonanLocalTest) { - goldValue = "f1\ns1\n117\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_finally3.kt" } task coroutines_controlFlow_finally4(type: KonanLocalTest) { - goldValue = "s1\nfinally\n42\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_finally4.kt" } task coroutines_controlFlow_finally5(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "s1\nf2\nfinally\n1\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_finally5.kt" } task coroutines_controlFlow_finally6(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "s1\nfinally\nerror\n0\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_finally6.kt" } task coroutines_controlFlow_finally7(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "s1\nf2\nfinally1\ns2\nfinally2\n42\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_finally7.kt" } task coroutines_controlFlow_inline1(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_inline1.kt" } task coroutines_controlFlow_inline2(type: KonanLocalTest) { - goldValue = "s1\n42\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_inline2.kt" } task coroutines_controlFlow_inline3(type: KonanLocalTest) { - goldValue = "f1\ns1\n42\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_inline3.kt" } task coroutines_controlFlow_tryCatch1(type: KonanLocalTest) { - goldValue = "s1\n42\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_tryCatch1.kt" } task coroutines_controlFlow_tryCatch2(type: KonanLocalTest) { - goldValue = "s1\n42\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_tryCatch2.kt" } task coroutines_controlFlow_tryCatch3(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "s2\nf2\n1\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_tryCatch3.kt" } task coroutines_controlFlow_tryCatch4(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "s2\nf2\n1\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_tryCatch4.kt" } task coroutines_controlFlow_tryCatch5(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "s2\ns1\nError\n42\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_tryCatch5.kt" } task coroutines_controlFlow_while1(type: KonanLocalTest) { - goldValue = "s3\ns3\ns3\ns3\n3\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_while1.kt" } task coroutines_controlFlow_while2(type: KonanLocalTest) { - goldValue = "s3\ns3\ns3\n3\n" + useGoldenData = true source = "codegen/coroutines/controlFlow_while2.kt" } task coroutines_returnsNothing1(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/coroutines/returnsNothing1.kt" } task coroutines_returnsUnit1(type: KonanLocalTest) { - goldValue = "117\ns1\n0\n" + useGoldenData = true source = "codegen/coroutines/returnsUnit1.kt" } task coroutines_coroutineContext1(type: KonanLocalTest) { - goldValue = "EmptyCoroutineContext\n" + useGoldenData = true source = "codegen/coroutines/coroutineContext1.kt" } task coroutines_coroutineContext2(type: KonanLocalTest) { - goldValue = "EmptyCoroutineContext\n" + useGoldenData = true source = "codegen/coroutines/coroutineContext2.kt" } task coroutines_anonymousObject(type: KonanLocalTest) { - goldValue = "zzz\n" + useGoldenData = true source = "codegen/coroutines/anonymousObject.kt" } task coroutines_functionReference_simple(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/coroutines/functionReference_simple.kt" } task coroutines_functionReference_eqeq_name(type: KonanLocalTest) { - goldValue = "" + useGoldenData = true source = "codegen/coroutines/functionReference_eqeq_name.kt" } task coroutines_functionReference_invokeAsFunction(type: KonanLocalTest) { - goldValue = "159\n" + useGoldenData = true source = "codegen/coroutines/functionReference_invokeAsFunction.kt" } task coroutines_functionReference_lambdaAsSuspendLambda(type: KonanLocalTest) { - goldValue = "" + useGoldenData = true source = "codegen/coroutines/functionReference_lambdaAsSuspendLambda.kt" } task coroutines_kt41394(type: KonanLocalTest) { - goldValue = "" + useGoldenData = true source = "codegen/coroutines/kt41394.kt" } standaloneTest('coroutines_suspendConversion') { - goldValue = "" + useGoldenData = true source = "codegen/coroutines/suspendConversion.kt" flags = ['-XXLanguage:+SuspendConversion'] } @@ -2150,33 +2109,33 @@ task BitSet(type: KonanLocalTest) { } task stack_array(type: KonanLocalTest) { - goldValue = "true\n3\n" + useGoldenData = true source = "runtime/collections/stack_array.kt" } task array0(type: KonanLocalTest) { - goldValue = "5\n6\n7\n8\n9\n10\n11\n12\n13\n" + useGoldenData = true source = "runtime/collections/array0.kt" } task array1(type: KonanLocalTest) { - goldValue = "4 2\n1-1\n69\n38\n" + useGoldenData = true source = "runtime/collections/array1.kt" } task array2(type: KonanLocalTest) { - goldValue = "0\n2\n4\n6\n8\n40\n" + useGoldenData = true source = "runtime/collections/array2.kt" } task array3(type: KonanLocalTest) { - goldValue = "1 2 3 7 8 9 -128 -1 \n1 2 3 7 8 9 -128 -1 \n" + useGoldenData = true source = "runtime/collections/array3.kt" } task array4(type: KonanLocalTest) { disabled = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "OK\n" + useGoldenData = true source = "runtime/collections/array4.kt" } @@ -2186,24 +2145,24 @@ task array5(type: KonanLocalTest) { } task typed_array0(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "runtime/collections/typed_array0.kt" } task typed_array1(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // No exceptions on WASM. - goldValue = "OK\n" + useGoldenData = true source = "runtime/collections/typed_array1.kt" } task sort0(type: KonanLocalTest) { - goldValue = "[a, b, x]\n[-1, 0, 42, 239, 100500]\n" + useGoldenData = true source = "runtime/collections/sort0.kt" } task sort1(type: KonanLocalTest) { - goldValue = "[a, b, x]\n[-1, 0, 42, 239, 100500]\n" + useGoldenData = true source = "runtime/collections/sort1.kt" } @@ -2217,7 +2176,7 @@ task if_else(type: KonanLocalTest) { task immutable_binary_blob_in_lambda(type: KonanLocalTest) { source = "lower/immutable_blob_in_lambda.kt" - goldValue = "123\n" + useGoldenData = true } task when2(type: KonanLocalTest) { @@ -2238,11 +2197,11 @@ task when7(type: KonanLocalTest) { task when8(type: KonanLocalTest) { source = "codegen/branching/when8.kt" - goldValue = "true\n" + useGoldenData = true } task when9(type: KonanLocalTest) { - goldValue = "Ok\n" + useGoldenData = true source = "codegen/branching/when9.kt" } @@ -2259,7 +2218,7 @@ task advanced_when5(type: KonanLocalTest) { } task when_with_try1(type: KonanLocalTest) { - goldValue = "null\nnull\n42\n" + useGoldenData = true source = "codegen/branching/when_with_try1.kt" } @@ -2290,8 +2249,8 @@ task eqeq(type: KonanLocalTest) { } task function_referenceBigArity(type: KonanLocalTest) { - goldValue = "528\n" - source = "codegen/function/referenceBigArity" + useGoldenData = true + source = "codegen/function/referenceBigArity.kt" } task cycle(type: KonanLocalTest) { @@ -2316,11 +2275,11 @@ task vtable1(type: KonanLocalTest) { task vtable_any(type: KonanLocalTest) { source = "datagen/rtti/vtable_any.kt" - goldValue = "[1]\n[2]\n[3]\n[4]\n" + useGoldenData = true } task strdedup1(type: KonanLocalTest) { - goldValue = "true\ntrue\n" + useGoldenData = true source = "datagen/literals/strdedup1.kt" } @@ -2329,12 +2288,12 @@ task strdedup2(type: KonanLocalTest) { // linking them as bitcode modules before translating to machine code. enabled = false - goldValue = "true\ntrue\n" + useGoldenData = true source = "datagen/literals/strdedup2.kt" } task empty_string(type: KonanLocalTest) { - goldValue = "\n" + useGoldenData = true source = "datagen/literals/empty_string.kt" } @@ -2342,40 +2301,50 @@ task intrinsic(type: KonanLocalTest) { source = "codegen/function/intrinsic.kt" } -/* - Disabled until we extract the classes that should be - always present from stdlib into a separate binary. - -linkTest("link") { - goldValue = "0\n" - source = "link/src/bar.kt" - lib = "link/lib" -}( -*/ +// Disabled until we extract the classes that should be +// always present from stdlib into a separate binary. +// +//linkTest("link") { +// useGoldenData = true +// source = "link/src/bar.kt" +// lib = "link/lib" +//}( linkTest("link_omit_unused") { - goldValue = "Hello\n" - source = "link/omit/hello.kt" - lib = "link/omit/lib.kt" + useGoldenData = true + source = "link/omit/main.kt" + lib = "link/omit/library.kt" } standaloneTest("link_default_libs") { enabled = (project.testTarget != 'wasm32') // there will be no posix.klib for wasm - goldValue = "sizet = 0\n" + useGoldenData = true source = "link/default/default.kt" UtilsKt.dependsOnPlatformLibs(it) } -standaloneTest("link_testLib_explicitly") { - // there are no testLibrary for cross targets yet. - enabled = project.target.name == project.hostName - +standaloneTest("link_testLib_explicitly1") { + // there is no testLibrary for cross targets yet. + enabled = project.target.name == project.hostName && + (project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM) dependsOn installTestLib - if (project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM) - goldValue = "Hello\n" - else - goldValue = "This is a side effect of a test library linked into the binary.\nYou should not be seeing this.\n\nHello\n" - source = "link/omit/hello.kt" + useGoldenData = true + source = "link/testLib_explicitly1.kt" + // We force library inclusion, so need to see the warning banner. + flags = ['-l', 'testLibrary', '-r', testLibraryDir] + doLast { + def file = new File("$testLibraryDir/testLibrary") + file.deleteDir() + } +} + +standaloneTest("link_testLib_explicitly2") { + // there is no testLibrary for cross targets yet. + enabled = project.target.name == project.hostName && + !(project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM) + dependsOn installTestLib + useGoldenData = true + source = "link/testLib_explicitly2.kt" // We force library inclusion, so need to see the warning banner. flags = ['-l', 'testLibrary', '-r', testLibraryDir] doLast { @@ -2386,24 +2355,24 @@ standaloneTest("link_testLib_explicitly") { linkTest("no_purge_for_dependencies") { enabled = (project.testTarget != 'wasm32') // there will be no posix.klib for wasm - goldValue = "linked library\nand symbols from posix available: 17; 1.0\n" + useGoldenData = true source = "link/purge1/prog.kt" lib = "link/purge1/lib.kt" UtilsKt.dependsOnPlatformLibs(it) } task for0(type: KonanLocalTest) { - goldValue = "2\n3\n4\n" + useGoldenData = true source = "runtime/basic/for0.kt" } task throw0(type: KonanLocalTest) { - goldValue = "Done\n" + useGoldenData = true source = "runtime/basic/throw0.kt" } task statements0(type: KonanLocalTest) { - goldValue = "239\n238\n30\n29\n" + useGoldenData = true source = "runtime/basic/statements0.kt" } @@ -2413,118 +2382,103 @@ standaloneTest("annotations0") { } task boxing0(type: KonanLocalTest) { - goldValue = "17\n" + useGoldenData = true source = "codegen/boxing/boxing0.kt" } task boxing1(type: KonanLocalTest) { - goldValue = "1\nfalse\nHello\n" + useGoldenData = true source = "codegen/boxing/boxing1.kt" } task boxing2(type: KonanLocalTest) { - goldValue = "1\ntrue\nother\n" + useGoldenData = true source = "codegen/boxing/boxing2.kt" } task boxing3(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/boxing/boxing3.kt" } task boxing4(type: KonanLocalTest) { - goldValue = "16\n" + useGoldenData = true source = "codegen/boxing/boxing4.kt" } task boxing5(type: KonanLocalTest) { - goldValue = "16\n42\n" + useGoldenData = true source = "codegen/boxing/boxing5.kt" } task boxing6(type: KonanLocalTest) { - goldValue = "42\n16\n" + useGoldenData = true source = "codegen/boxing/boxing6.kt" } task boxing7(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "1\n0\n" + useGoldenData = true source = "codegen/boxing/boxing7.kt" } task boxing8(type: KonanLocalTest) { - goldValue = "1\nnull\ntrue\nHello\n" + useGoldenData = true source = "codegen/boxing/boxing8.kt" } task boxing9(type: KonanLocalTest) { - goldValue = "1\nnull\ntrue\nHello\n2\nnull\ntrue\nHello\n3\n" + useGoldenData = true source = "codegen/boxing/boxing9.kt" } task boxing10(type: KonanLocalTest) { - goldValue = "Ok\n" + useGoldenData = true source = "codegen/boxing/boxing10.kt" } task boxing11(type: KonanLocalTest) { - goldValue = "17\n42\n" + useGoldenData = true source = "codegen/boxing/boxing11.kt" } task boxing12(type: KonanLocalTest) { - goldValue = "18\n" + useGoldenData = true source = "codegen/boxing/boxing12.kt" } task boxing13(type: KonanLocalTest) { - goldValue = "false\nfalse\ntrue\ntrue\nfalse\nfalse\n" + useGoldenData = true source = "codegen/boxing/boxing13.kt" } task boxing14(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/boxing/boxing14.kt" } task boxing15(type: KonanLocalTest) { - goldValue = "17\n" + useGoldenData = true source = "codegen/boxing/boxing15.kt" } task boxCache0(type: KonanLocalTest) { - goldValue = "2\n256\n256\n256\n256\n256\n" + useGoldenData = true source = "codegen/boxing/box_cache0.kt" } task interface0(type: KonanLocalTest) { - goldValue = "PASSED\n" + useGoldenData = true source = "runtime/basic/interface0.kt" } task hash0(type: KonanLocalTest) { - goldValue = "239\n0\n97\n1065353216\n1072693248\n1\n0\ntrue\ntrue\n" + useGoldenData = true source = "runtime/basic/hash0.kt" } task ieee754(type: KonanLocalTest) { - goldValue = "Infinity 2147483647 -1\n" + - "3.4028235E38\n" + - "NAN2SHORT:: 0\n" + - "2147483647 -1\n" + - "FLOAT:: Infinity INT:: 2147483647\n" + - "FLOAT:: 1.7014117E38 INT:: 2147483647\n" + - "FLOAT:: 3.4028235E38 INT:: 2147483647\n" + - "FLOAT:: 3.14 INT:: 3\n" + - "FLOAT:: NaN INT:: 0\n" + - "FLOAT:: -33333.125 INT:: -33333\n" + - "FLOAT:: 1.4E-45 INT:: 0\n" + - "FLOAT:: -Infinity INT:: -2147483648\n" + - "FLOAT:: -1.2 INT:: -1\n" + - "FLOAT:: -12.6 INT:: -12\n" + - "FLOAT:: 2.3 INT:: 2\n" + - "OK\n" + useGoldenData = true source = "runtime/basic/ieee754.kt" } @@ -2533,66 +2487,66 @@ standaloneTest("hypotenuse") { } task array_list1(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "runtime/collections/array_list1.kt" } task array_list2(type: KonanLocalTest) { enabled = (project.testTarget != 'wasm32') // uses exceptions - goldValue = "OK\n" + useGoldenData = true source = "runtime/collections/array_list2.kt" } task hash_map0(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "runtime/collections/hash_map0.kt" } task hash_map1(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "runtime/collections/hash_map1.kt" } task hash_set0(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "runtime/collections/hash_set0.kt" } task listof0(type: KonanLocalTest) { - goldValue = "abc\n[a, b, c, d]\n[n, s, a]\n" + useGoldenData = true source = "runtime/collections/listof0.kt" } task listof1(type: KonanLocalTest) { enabled = false - goldValue = "true\n[a, b, c]\n" + useGoldenData = true source = "datagen/literals/listof1.kt" } task moderately_large_array(type: KonanLocalTest) { - goldValue = "0\n" + useGoldenData = true source = "runtime/collections/moderately_large_array.kt" } task moderately_large_array1(type: KonanLocalTest) { - goldValue = "-45392\n" + useGoldenData = true source = "runtime/collections/moderately_large_array1.kt" } task string_builder0(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "OK\n" + useGoldenData = true source = "runtime/text/string_builder0.kt" } task string_builder1(type: KonanLocalTest) { - goldValue = "HelloKotlin\n42\n0.1\ntrue\n\n" + useGoldenData = true source = "runtime/text/string_builder1.kt" } task string0(type: KonanLocalTest) { - goldValue = "true\ntrue\nПРИВЕТ\nпривет\nПока\ntrue\n" + useGoldenData = true source = "runtime/text/string0.kt" } @@ -2601,13 +2555,13 @@ task parse0(type: KonanLocalTest) { } task to_string0(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "runtime/text/to_string0.kt" } task trim(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions - goldValue = "OK\n" + useGoldenData = true source = "runtime/text/trim.kt" } @@ -2624,30 +2578,30 @@ task indexof(type: KonanLocalTest) { task utf8(type: KonanLocalTest) { // Uses exceptions so cannot run on wasm. enabled = project.testTarget != 'wasm32' - goldValue = "Hello\nПривет\n\uD800\uDC00\n\n\uFFFD\uFFFD\n\uFFFD12\n\uFFFD12\n12\uFFFD\n\uD83D\uDE25\n\uD83D\uDE25\n" + useGoldenData = true source = "runtime/text/utf8.kt" } task catch1(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "Before\nCaught Throwable\nDone\n" + useGoldenData = true source = "runtime/exceptions/catch1.kt" } task catch2(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "Before\nCaught Error\nDone\n" + useGoldenData = true source = "runtime/exceptions/catch2.kt" } task catch7(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "Error happens\n" + useGoldenData = true source = "runtime/exceptions/catch7.kt" } task extend_exception(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "runtime/exceptions/extend0.kt" } @@ -2712,7 +2666,7 @@ standaloneTest("custom_hook_throws") { standaloneTest("custom_hook_unhandled_exception") { enabled = (project.testTarget != 'wasm32') // Uses exceptions. - goldValue = "" + useGoldenData = true source = "runtime/exceptions/custom_hook_unhandled_exception.kt" } @@ -2783,171 +2737,171 @@ standaloneTest("runtime_math_harmony") { } task catch3(type: KonanLocalTest) { - goldValue = "Before\nCaught Throwable\nDone\n" + useGoldenData = true source = "codegen/try/catch3.kt" } task catch4(type: KonanLocalTest) { - goldValue = "Before\nCaught Error\nDone\n" + useGoldenData = true source = "codegen/try/catch4.kt" } task catch5(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "Before\nCaught Error\nDone\n" + useGoldenData = true source = "codegen/try/catch5.kt" } task catch6(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "Before\nCaught Error\nDone\n" + useGoldenData = true source = "codegen/try/catch6.kt" } task catch8(type: KonanLocalTest) { - goldValue = "Error happens\n" + useGoldenData = true source = "codegen/try/catch8.kt" } task finally1(type: KonanLocalTest) { - goldValue = "Try\nFinally\nDone\n" + useGoldenData = true source = "codegen/try/finally1.kt" } task finally2(type: KonanLocalTest) { - goldValue = "Try\nCaught Error\nFinally\nDone\n" + useGoldenData = true source = "codegen/try/finally2.kt" } task finally3(type: KonanLocalTest) { - goldValue = "Try\nFinally\nCaught Error\nDone\n" + useGoldenData = true source = "codegen/try/finally3.kt" } task finally4(type: KonanLocalTest) { - goldValue = "Try\nCatch\nFinally\nCaught Exception\nDone\n" + useGoldenData = true source = "codegen/try/finally4.kt" } task finally5(type: KonanLocalTest) { - goldValue = "Done\nFinally\n0\n" + useGoldenData = true source = "codegen/try/finally5.kt" } task finally6(type: KonanLocalTest) { - goldValue = "Done\nFinally\n1\n" + useGoldenData = true source = "codegen/try/finally6.kt" } task finally7(type: KonanLocalTest) { - goldValue = "Done\nFinally\n1\n" + useGoldenData = true source = "codegen/try/finally7.kt" } task finally8(type: KonanLocalTest) { - goldValue = "Finally 1\nFinally 2\n42\n" + useGoldenData = true source = "codegen/try/finally8.kt" } task finally9(type: KonanLocalTest) { - goldValue = "Finally 1\nFinally 2\nAfter\n" + useGoldenData = true source = "codegen/try/finally9.kt" } task finally10(type: KonanLocalTest) { - goldValue = "Finally\nAfter\n" + useGoldenData = true source = "codegen/try/finally10.kt" } task finally11(type: KonanLocalTest) { - goldValue = "Finally\nCatch 2\nDone\n" + useGoldenData = true source = "codegen/try/finally11.kt" } task finally_returnsDifferentTypes(type: KonanLocalTest) { - goldValue = "zzz\n42\n" + useGoldenData = true source = "codegen/try/returnsDifferentTypes.kt" } task scope1(type: KonanLocalTest) { - goldValue = "1\n" + useGoldenData = true source = "codegen/dataflow/scope1.kt" } task uninitialized_val(type: KonanLocalTest) { - goldValue = "1\n2\n" + useGoldenData = true source = "codegen/dataflow/uninitialized_val.kt" } task try1(type: KonanLocalTest) { - goldValue = "5\n" + useGoldenData = true source = "codegen/try/try1.kt" } task try2(type: KonanLocalTest) { - goldValue = "6\n" + useGoldenData = true source = "codegen/try/try2.kt" } task try3(type: KonanLocalTest) { - goldValue = "6\n" + useGoldenData = true source = "codegen/try/try3.kt" } task try4(type: KonanLocalTest) { - goldValue = "Try\n5\n" + useGoldenData = true source = "codegen/try/try4.kt" } task unreachable1(type: KonanLocalTest) { - goldValue = "1\n" + useGoldenData = true source = "codegen/controlflow/unreachable1.kt" } task break_continue(type: KonanLocalTest) { - goldValue = "foo@l1\nfoo@l2\nfoo@l2\nfoo@l2\nbar@l1\nbar@l2\nbar@l2\nbar@l2\nqux@t1\nqux@l2\nqux@l2\nqux@l2\n" + useGoldenData = true source = "codegen/controlflow/break.kt" } task break1(type: KonanLocalTest) { - goldValue = "Body\nDone\n" + useGoldenData = true source = "codegen/controlflow/break1.kt" } task range0(type: KonanLocalTest) { - goldValue = "123\nabcd\n" + useGoldenData = true source = "runtime/collections/range0.kt" } standaloneTest("args0") { arguments = ["AAA", "BB", "C"] - goldValue = "AAA\nBB\nC\n" + useGoldenData = true source = "runtime/basic/args0.kt" } standaloneTest("devirtualization_lateinitInterface") { disabled = (cacheTesting != null) // Cache is not compatible with -opt. - goldValue = "42\n" + useGoldenData = true flags = ["-opt"] source = "codegen/devirtualization/lateinitInterface.kt" } standaloneTest("devirtualization_getter_looking_as_box_function") { disabled = (cacheTesting != null) // Cache is not compatible with -opt. - goldValue = "box\n" + useGoldenData = true flags = ["-opt"] source = "codegen/devirtualization/getter_looking_as_box_function.kt" } standaloneTest("devirtualization_anonymousObject") { disabled = (cacheTesting != null) // Cache is not compatible with -opt. - goldValue = "zzz\n" + useGoldenData = true flags = ["-opt"] source = "codegen/devirtualization/anonymousObject.kt" } task interfaceCallsNCasts_conservativeItable(type: KonanLocalTest) { - goldValue = "539\n5050\n26551140\n" + useGoldenData = true source = "codegen/interfaceCallsNCasts/conservativeItable.kt" } @@ -2959,18 +2913,8 @@ task interfaceCallsNCasts_diamond(type: KonanLocalTest) { source = "codegen/interfaceCallsNCasts/diamond.kt" } -standaloneTest("multiargs") { - arguments = ["AAA", "BB", "C"] - multiRuns = true - multiArguments = [["1", "2", "3"], ["---"], ["Hello", "world"]] - goldValue = "AAA\nBB\nC\n1\n2\n3\n" + - "AAA\nBB\nC\n---\n" + - "AAA\nBB\nC\nHello\nworld\n" - source = "runtime/basic/args0.kt" -} - task spread_operator_0(type: KonanLocalTest) { - goldValue = "[K, o, t, l, i, n, , i, s, , c, o, o, l, , l, a, n, g, u, a, g, e]\n" + useGoldenData = true source = "codegen/basics/spread_operator_0.kt" } @@ -3001,30 +2945,20 @@ standaloneTest("runtime_basic_assert_disabled") { } task initializers0(type: KonanLocalTest) { - goldValue = "main\n" + - "B::constructor(1)\n" + - "A::companion\n" + - "A::companion::foo\n" + - "A::companion::foo\n" + - "B::constructor(0)\n" + - "B::constructor()\n" + - "A::Obj\n" + - "A::AObj::foo\n" + - "A::AObj::foo\n" + useGoldenData = true source = "runtime/basic/initializers0.kt" } task initializers1(type: KonanLocalTest) { - goldValue = "Init Test\n" + - "Done\n" + useGoldenData = true enabled = false source = "runtime/basic/initializers1.kt" } task concatenation(type: KonanLocalTest) { - goldValue = "Hello world 1 2\nHello, a\nHello, b\n" + useGoldenData = true source = "codegen/basics/concatenation.kt" } @@ -3033,68 +2967,68 @@ task const_infinity(type: KonanLocalTest) { } task lambda1(type: KonanLocalTest) { - goldValue = "lambda\n" + useGoldenData = true source = "codegen/lambda/lambda1.kt" } task lambda2(type: KonanLocalTest) { arguments = ["arg0"] - goldValue = "arg0\n" + useGoldenData = true source = "codegen/lambda/lambda2.kt" } task lambda3(type: KonanLocalTest) { - goldValue = "lambda\n" + useGoldenData = true source = "codegen/lambda/lambda3.kt" } task lambda4(type: KonanLocalTest) { - goldValue = "1\n2\n3\n3\n4\n" + useGoldenData = true source = "codegen/lambda/lambda4.kt" } task lambda5(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/lambda/lambda5.kt" } task lambda6(type: KonanLocalTest) { - goldValue = "42\ncaptured\n" + useGoldenData = true source = "codegen/lambda/lambda6.kt" } task lambda7(type: KonanLocalTest) { - goldValue = "43\n" + useGoldenData = true source = "codegen/lambda/lambda7.kt" } task lambda8(type: KonanLocalTest) { - goldValue = "first\n0\nsecond\n0\nfirst\n1\nsecond\n1\n" + useGoldenData = true source = "codegen/lambda/lambda8.kt" } task lambda9(type: KonanLocalTest) { - goldValue = "0\n0\n1\n0\n0\n1\n1\n1\n" + useGoldenData = true source = "codegen/lambda/lambda9.kt" } task lambda10(type: KonanLocalTest) { - goldValue = "original\nchanged\n" + useGoldenData = true source = "codegen/lambda/lambda10.kt" } task lambda11(type: KonanLocalTest) { - goldValue = "first\nsecond\n" + useGoldenData = true source = "codegen/lambda/lambda11.kt" } task lambda12(type: KonanLocalTest) { - goldValue = "one\ntwo\n" + useGoldenData = true source = "codegen/lambda/lambda12.kt" } task lambda13(type: KonanLocalTest) { - goldValue = "foo\n" + useGoldenData = true source = "codegen/lambda/lambda13.kt" } @@ -3116,42 +3050,38 @@ task funInterface_kt43887(type: KonanLocalTest) { } task objectExpression1(type: KonanLocalTest) { - goldValue = "aabb\n" + useGoldenData = true source = "codegen/objectExpression/expr1.kt" } task objectExpression2(type: KonanLocalTest) { - goldValue = "a\n" + useGoldenData = true source = "codegen/objectExpression/expr2.kt" } task objectExpression3(type: KonanLocalTest) { - goldValue = "\n1\n2\n" + useGoldenData = true source = "codegen/objectExpression/expr3.kt" } standaloneTest("initializers2") { - goldValue = "init globalValue2\n" + - "init globalValue3\n" + - "1\n" + - "globalValue2\n" + - "globalValue3\n" + useGoldenData = true source = "runtime/basic/initializers2.kt" } task initializers3(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "runtime/basic/initializers3.kt" } task initializers4(type: KonanLocalTest) { - goldValue = "1073741824\ntrue\n" + useGoldenData = true source = "runtime/basic/initializers4.kt" } task initializers5(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "runtime/basic/initializers5.kt" } @@ -3170,7 +3100,7 @@ task initializers8(type: KonanLocalTest) { task expression_as_statement(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // uses exceptions. - goldValue = "Ok\n" + useGoldenData = true source = "codegen/basics/expression_as_statement.kt" } @@ -3208,7 +3138,7 @@ task memory_var4(type: KonanLocalTest) { task memory_throw_cleanup(type: KonanLocalTest) { expectedFail = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "Ok\n" + useGoldenData = true source = "runtime/memory/throw_cleanup.kt" } @@ -3217,12 +3147,12 @@ task memory_escape0(type: KonanLocalTest) { } task memory_escape1(type: KonanLocalTest) { - goldValue = "zzz\n" + useGoldenData = true source = "runtime/memory/escape1.kt" } task memory_cycles0(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "runtime/memory/cycles0.kt" } @@ -3236,18 +3166,18 @@ task memory_basic0(type: KonanLocalTest) { } task memory_escape2(type: KonanLocalTest) { - goldValue = "zzz\n" + useGoldenData = true source = "runtime/memory/escape2.kt" } task memory_weak0(type: KonanLocalTest) { enabled = !isNoopGC - goldValue = "Data(s=Hello)\nnull\nOK\n" + useGoldenData = true source = "runtime/memory/weak0.kt" } task memory_weak1(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "runtime/memory/weak1.kt" } @@ -3314,7 +3244,7 @@ standaloneTest("mpp1") { } linkTest("mpp2") { - goldValue = "C(arg=42)\ntrue\n1\nh\n" + useGoldenData = true source = "codegen/mpp/mpp2.kt" lib = "codegen/mpp/libmpp2.kt" flags = ['-Xmulti-platform'] @@ -3368,22 +3298,22 @@ standaloneTest("freezing_control_basic_explicitOnly") { } task unit1(type: KonanLocalTest) { - goldValue = "First\nkotlin.Unit\n" + useGoldenData = true source = "codegen/basics/unit1.kt" } task unit2(type: KonanLocalTest) { - goldValue = "kotlin.Unit\n" + useGoldenData = true source = "codegen/basics/unit2.kt" } task unit3(type: KonanLocalTest) { - goldValue = "kotlin.Unit\n" + useGoldenData = true source = "codegen/basics/unit3.kt" } task unit4(type: KonanLocalTest) { - goldValue = "Done\n" + useGoldenData = true source = "codegen/basics/unit4.kt" } @@ -3396,7 +3326,7 @@ task kt42000_2(type: KonanLocalTest) { } task inline0(type: KonanLocalTest) { - goldValue = "84\n" + useGoldenData = true source = "codegen/inline/inline0.kt" } @@ -3406,217 +3336,210 @@ task vararg0(type: KonanLocalTest) { task vararg_of_literals(type: KonanLocalTest) { enabled = false - goldValue = "a\na\n" + useGoldenData = true source = "lower/vararg_of_literals.kt" } standaloneTest('tailrec') { - goldValue = "12\n100000000\n" + - "8\n" + - "1\n" + - "3 ...\n2 ...\n1 ...\nready!\n" + - "2\n-1\n" + - "true\nfalse\n" + - "default\n" + - "42\n" + useGoldenData = true source = "lower/tailrec.kt" flags = ['-XXLanguage:-ProhibitTailrecOnVirtualMember', '-e', 'lower.tailrec.main'] } task inline1(type: KonanLocalTest) { - goldValue = "Hello world\n" + useGoldenData = true source = "codegen/inline/inline1.kt" } task inline2(type: KonanLocalTest) { - goldValue = "hello 1 8\n" + useGoldenData = true source = "codegen/inline/inline2.kt" } task inline3(type: KonanLocalTest) { - goldValue = "5\n" + useGoldenData = true source = "codegen/inline/inline3.kt" } task inline4(type: KonanLocalTest) { - goldValue = "3\n" + useGoldenData = true source = "codegen/inline/inline4.kt" } task inline5(type: KonanLocalTest) { - goldValue = "33\n" + useGoldenData = true source = "codegen/inline/inline5.kt" } task inline6(type: KonanLocalTest) { - goldValue = "hello1\nhello2\nhello3\nhello4\n" + useGoldenData = true source = "codegen/inline/inline6.kt" } task inline7(type: KonanLocalTest) { - goldValue = "1\n2\n3\n" + useGoldenData = true source = "codegen/inline/inline7.kt" } task inline8(type: KonanLocalTest) { - goldValue = "8\n" + useGoldenData = true source = "codegen/inline/inline8.kt" } task inline9(type: KonanLocalTest) { - goldValue = "hello\n6\n" + useGoldenData = true source = "codegen/inline/inline9.kt" } task inline10(type: KonanLocalTest) { - goldValue = "2\n" + useGoldenData = true source = "codegen/inline/inline10.kt" } task inline13(type: KonanLocalTest) { - goldValue = "true\n" + useGoldenData = true source = "codegen/inline/inline13.kt" } task inline14(type: KonanLocalTest) { - goldValue = "9\n" + useGoldenData = true source = "codegen/inline/inline14.kt" } task inline15(type: KonanLocalTest) { - goldValue = "4\n" + useGoldenData = true source = "codegen/inline/inline15.kt" } task inline16(type: KonanLocalTest) { - goldValue = "false\n" + useGoldenData = true source = "codegen/inline/inline16.kt" } task inline17(type: KonanLocalTest) { - goldValue = "[1, 2]\n" + useGoldenData = true source = "codegen/inline/inline17.kt" } task inline18(type: KonanLocalTest) { - goldValue = "true\n" + useGoldenData = true source = "codegen/inline/inline18.kt" } task inline19(type: KonanLocalTest) { - goldValue = "6\n" + useGoldenData = true source = "codegen/inline/inline19.kt" } task inline20(type: KonanLocalTest) { - goldValue = "def\n" + useGoldenData = true source = "codegen/inline/inline20.kt" } task inline21(type: KonanLocalTest) { - goldValue = "bar\nfoo1\nfoo2\n33\n" + useGoldenData = true source = "codegen/inline/inline21.kt" } task inline22(type: KonanLocalTest) { - goldValue = "14\n" + useGoldenData = true source = "codegen/inline/inline22.kt" } task inline23(type: KonanLocalTest) { - goldValue = "33\n" + useGoldenData = true source = "codegen/inline/inline23.kt" } task inline24(type: KonanLocalTest) { enabled = false - goldValue = "bar\nfoo\n" + useGoldenData = true source = "codegen/inline/inline24.kt" } task inline25(type: KonanLocalTest) { - goldValue = "Ok\nOk\n" + useGoldenData = true source = "codegen/inline/inline25.kt" } task inline26(type: KonanLocalTest) { - goldValue = "5\n" + useGoldenData = true source = "codegen/inline/inline26.kt" } task inline_type_substitution_in_fake_override(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/inline/typeSubstitutionInFakeOverride.kt" } task inline_localFunctionInInitializerBlock(type: KonanLocalTest) { - goldValue = "Ok\n" + useGoldenData = true source = "codegen/inline/localFunctionInInitializerBlock.kt" } task inline_lambdaInDefaultValue(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/inline/lambdaInDefaultValue.kt" } task inline_lambdaAsAny(type: KonanLocalTest) { - goldValue = "Ok\n" + useGoldenData = true source = "codegen/inline/lambdaAsAny.kt" } task inline_getClass(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/inline/getClass.kt" } task inline_statementAsLastExprInBlock(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/inline/statementAsLastExprInBlock.kt" } task inline_returnLocalClassFromBlock(type: KonanLocalTest) { enabled = false - goldValue = "Zzz\n" + useGoldenData = true source = "codegen/inline/returnLocalClassFromBlock.kt" } task inline_changingCapturedLocal(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/inline/changingCapturedLocal.kt" } task inline_defaultArgs(type: KonanLocalTest) { - goldValue = "42\n" + useGoldenData = true source = "codegen/inline/defaultArgs.kt" } task inline_propertyAccessorInline(type: KonanLocalTest) { - goldValue = "123\n42\n" + useGoldenData = true source = "codegen/inline/propertyAccessorInline.kt" } task inline_twiceInlinedObject(type: KonanLocalTest) { - goldValue = "Ok\n" + useGoldenData = true source = "codegen/inline/twiceInlinedObject.kt" } task inline_localObjectReturnedFromWhen(type: KonanLocalTest) { - goldValue = "Ok\n" + useGoldenData = true source = "codegen/inline/localObjectReturnedFromWhen.kt" } task inline_genericFunctionReference(type: KonanLocalTest) { - goldValue = "0\n" + useGoldenData = true source = "codegen/inline/genericFunctionReference.kt" } task inline_correctOrderFunctionReference(type: KonanLocalTest) { - goldValue = "OK\n" + useGoldenData = true source = "codegen/inline/correctOrderFunctionReference.kt" } task inline_coercionToUnit(type: KonanLocalTest) { - goldValue = "kotlin.Unit\n" + useGoldenData = true source = "codegen/inline/coercionToUnit.kt" } @@ -3626,7 +3549,7 @@ task inline_redundantCoercionsCleaner(type: KonanLocalTest) { task classDeclarationInsideInline(type: KonanLocalTest) { source = "codegen/inline/classDeclarationInsideInline.kt" - goldValue = "test1: 1.0\n1\ntest2\n" + useGoldenData = true } task inlineClass0(type: KonanLocalTest) { @@ -3692,85 +3615,57 @@ KotlinNativeTestKt.createTest(project, "kt39548", KonanStandaloneTest) { task -> } linkTest("deserialized_members") { - goldValue= - "first level\n"+ - "second level\n"+ - "third levelxz\n"+ - "inner first level\n"+ - "inner second level\n"+ - "inner third level\n"+ - "types first level: 13\n"+ - "types second level cha-cha-cha\n"+ - "types third level 1.0\n" - lib = "serialization/serialize_members.kt" - source = "serialization/deserialize_members.kt" + source = "serialization/deserialized_members/main.kt" + lib = "serialization/deserialized_members/library.kt" + useGoldenData = true } linkTest("serialized_catch") { - source = "serialization/use.kt" - lib = "serialization/catch.kt" - goldValue = "Gotcha1: XXX\nGotcha2: YYY\n" + source = "serialization/serialized_catch/main.kt" + lib = "serialization/serialized_catch/library.kt" + useGoldenData = true } linkTest("serialized_doWhile") { - source = "serialization/use.kt" - lib = "serialization/do_while.kt" - goldValue = "999\n" + source = "serialization/serialized_doWhile/main.kt" + lib = "serialization/serialized_doWhile/library.kt" + useGoldenData = true } linkTest("serialized_vararg") { - source = "serialization/use.kt" - lib = "serialization/vararg.kt" - goldValue = "17\n19\n23\n29\n31\nsize: 5\n" + source = "serialization/serialized_vararg/main.kt" + lib = "serialization/serialized_vararg/library.kt" + useGoldenData = true } linkTest("serialized_default_args") { - source = "serialization/prop.kt" - lib = "serialization/default_args.kt" - goldValue = "SomeDataClass(first=17, second=666, third=23)\n" + source = "serialization/serialized_default_args/main.kt" + lib = "serialization/serialized_default_args/library.kt" + useGoldenData = true } standaloneTest("serialized_no_typemap") { source = "serialization/regression/no_type_map.kt" - goldValue = "OK\n" + useGoldenData = true } linkTest("serialized_enum_ordinal") { source = "serialization/enum_ordinal/main.kt" lib = "serialization/enum_ordinal/library.kt" - goldValue = "0\n1\n2\nb\n" + useGoldenData = true } linkTest("serialized_char_constant") { - source = "serialization/use_char_const.kt" - lib = "serialization/char_const.kt" - goldValue = "Ы\n" + source = "serialization/serialized_char_constant/main.kt" + lib = "serialization/serialized_char_constant/library.kt" + useGoldenData = true } standaloneTest("testing_annotations") { source = "testing/annotations.kt" flags = ['-tr'] arguments = ['--ktest_logger=SIMPLE'] - goldValue = 'Starting testing\nStarting iteration: 1\n' + - 'Test suite ignored: kotlin.test.tests.IgnoredClass.IgnoredObject\n' + - 'Test suite ignored: kotlin.test.tests.IgnoredClass\nTest suite ignored: kotlin.test.tests.IgnoredObject\n' + - 'Starting test suite: kotlin.test.tests.A\nbeforeClass (A.companion)\n' + - 'Starting test case: test1 (kotlin.test.tests.A)\nbefore (A)\ntest1 (A)\nafter (A)\n' + - 'Passed: test1 (kotlin.test.tests.A)\nIgnore: ignoredTest (kotlin.test.tests.A)\n' + - 'afterClass (A.companion)\nTest suite finished: kotlin.test.tests.A\n' + - 'Starting test suite: kotlin.test.tests.A.O\nbeforeClass (A.object)\n' + - 'Starting test case: test1 (kotlin.test.tests.A.O)\nbefore (A.object)\n' + - 'test1 (A.object)\nafter (A.object)\nPassed: test1 (kotlin.test.tests.A.O)\n' + - 'Ignore: ignoredTest (kotlin.test.tests.A.O)\nafterClass (A.object)\n' + - 'Test suite finished: kotlin.test.tests.A.O\nStarting test suite: kotlin.test.tests.O\n' + - 'beforeClass (object)\nStarting test case: test1 (kotlin.test.tests.O)\nbefore (object)\n' + - 'test1 (object)\nafter (object)\nPassed: test1 (kotlin.test.tests.O)\n' + - 'Ignore: ignoredTest (kotlin.test.tests.O)\nafterClass (object)\nTest suite finished: kotlin.test.tests.O\n' + - 'Starting test suite: kotlin.test.tests.AnnotationsKt\nbeforeClass (file)\n' + - 'Starting test case: test1 (kotlin.test.tests.AnnotationsKt)\nbefore (file)\n' + - 'test1 (file)\nafter (file)\nPassed: test1 (kotlin.test.tests.AnnotationsKt)\n' + - 'Ignore: ignoredTest (kotlin.test.tests.AnnotationsKt)\nafterClass (file)\n' + - 'Test suite finished: kotlin.test.tests.AnnotationsKt\nIteration finished: 1\nTesting finished\n' + useGoldenData = true } standaloneTest("testing_assertions") { @@ -3784,23 +3679,7 @@ standaloneTest("testing_custom_main") { source = "testing/custom_main.kt" flags = ['-tr', '-e', 'kotlin.test.tests.main'] arguments = ['--ktest_logger=SIMPLE', '--ktest_repeat=2'] - goldValue = 'Custom main\n' + - 'Starting testing\n' + - 'Starting iteration: 1\n' + - 'Starting test suite: kotlin.test.tests.Custom_mainKt\n' + - 'Starting test case: test (kotlin.test.tests.Custom_mainKt)\n' + - 'test\n' + - 'Passed: test (kotlin.test.tests.Custom_mainKt)\n' + - 'Test suite finished: kotlin.test.tests.Custom_mainKt\n' + - 'Iteration finished: 1\n' + - 'Starting iteration: 2\n' + - 'Starting test suite: kotlin.test.tests.Custom_mainKt\n' + - 'Starting test case: test (kotlin.test.tests.Custom_mainKt)\n' + - 'test\n' + - 'Passed: test (kotlin.test.tests.Custom_mainKt)\n' + - 'Test suite finished: kotlin.test.tests.Custom_mainKt\n' + - 'Iteration finished: 2\n' + - 'Testing finished\n' + useGoldenData = true } standaloneTest("testing_library_usage") { @@ -3974,33 +3853,33 @@ standaloneTest("testing_stacktrace") { // Just check that the driver is able to produce runnable binaries. tasks.register("driver0", KonanDriverTest) { - goldValue = "Hello, world!\n" + useGoldenData = true source = "runtime/basic/driver0.kt" } tasks.register("driver_opt", KonanDriverTest) { disabled = (cacheTesting != null) // Cache is not compatible with -opt. - goldValue = "Hello, world!\n" - source = "runtime/basic/driver0.kt" + useGoldenData = true + source = "runtime/basic/driver_opt.kt" flags = ["-opt"] } // Enable when deserialization for default arguments is fixed. linkTest("inline_defaultArgs_linkTest") { - goldValue = "122\n47\n" + useGoldenData = true source = "codegen/inline/defaultArgs_linkTest_main.kt" lib = "codegen/inline/defaultArgs_linkTest_lib.kt" } linkTest("inline_sharedVar_linkTest") { - goldValue = "6\n" + useGoldenData = true source = "codegen/inline/sharedVar_linkTest_main.kt" lib = "codegen/inline/sharedVar_linkTest_lib.kt" } linkTest("inline_lateinitProperty_linkTest") { disabled = (project.testTarget == 'wasm32') // Uses exceptions. - goldValue = "OK\n" + useGoldenData = true source = "codegen/inline/lateinitProperty_linkTest_main.kt" lib = "codegen/inline/lateinitProperty_linkTest_lib.kt" } @@ -4361,21 +4240,21 @@ interopTest("interop0") { (project.testTarget == 'linux_mipsel32') || (project.testTarget == 'linux_arm32_hfp') || (project.testTarget == 'linux_arm64') - goldValue = "0\n0\n" + useGoldenData = true source = "interop/basics/0.kt" interop = 'sysstat' } interopTest("interop1") { disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. - goldValue = "257\n-1\n-2\n" + useGoldenData = true source = "interop/basics/1.kt" interop = 'cstdlib' } interopTest("interop2") { disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. - goldValue = "Hello\n" + useGoldenData = true source = "interop/basics/2.kt" interop = 'cstdio' } @@ -4390,21 +4269,21 @@ interopTest("interop3") { (project.testTarget == 'linux_mips32') || (project.testTarget == 'linux_mipsel32') || (project.testTarget == 'wasm32') // No interop for wasm yet. - goldValue = "8 9 12 13 14 \n" + useGoldenData = true source = "interop/basics/3.kt" interop = 'cstdlib' } interopTest("interop4") { disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. - goldValue = "a b -1 2 3 9223372036854775807 0.1 0.2 1 0\n1 42\n" + useGoldenData = true source = "interop/basics/4.kt" interop = 'cstdio' } standaloneTest("interop5") { enabled = (project.testTarget != 'wasm32') // No interop for wasm yet. - goldValue = "Hello!\n" + useGoldenData = true source = "interop/basics/5.kt" UtilsKt.dependsOnPlatformLibs(it) } @@ -4418,7 +4297,7 @@ interopTest("interop_bitfields") { interopTest("interop_funptr") { disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. - goldValue = "42\n17\n1\n0\n42\n42\n" + useGoldenData = true source = "interop/basics/funptr.kt" interop = 'cfunptr' } @@ -4508,8 +4387,7 @@ interopTest("interop_concurrentTerminate") { disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. source = "interop/concurrentTerminate/main.kt" interop = 'concurrentTerminate' - goldValue = "Reporting error!\n" - outputChecker = { str -> str.endsWith(goldValue) } + outputChecker = { str -> str.endsWith("Reporting error!\n") } expectedExitStatus = 99 } @@ -4622,7 +4500,7 @@ dynamicTest("interop_kt43502") { interop = "kt43502" source = "interop/kt43502/main.kt" cSource = "$projectDir/interop/kt43502/main.c" - goldValue = "null\n" + useGoldenData = true } interopTest("interop_leakMemoryWithRunningThreadUnchecked") { @@ -4675,11 +4553,7 @@ interopTest("interop_cppSkia") { isExperimentalMM) source = "interop/cpp/skia.kt" interop = 'cppSkia' - goldValue = - "SkFoo()\nSkData()\nSkData()\nSkValue()\nSkData()\n" + - "MANAGED: f: true, a: true, b: false, v: true, c: false\n" + - "DATA: 17 19 17 17\n" + - "unref\n~SkData()\n~SkFoo()\n" + useGoldenData = true UtilsKt.dependsOnPlatformLibs(it) } @@ -4687,9 +4561,7 @@ interopTest("interop_cppSkiaSignature") { disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. source = "interop/cpp/skiaSignature.kt" interop = "cppSkiaSignature" - goldValue = - "SkData()\nSkData(19)\nSkData(SkData*)\nSkData(SkData*, SkData*)\nSkData(200)\nSkData(436)\n"+ - "true true true true true\n" + useGoldenData = true UtilsKt.dependsOnPlatformLibs(it) } @@ -4715,24 +4587,9 @@ standaloneTest("interop_opengl_teapot") { if (PlatformInfo.isAppleTarget(project)) { interopTest("interop_objc_smoke") { - goldValue = "84\nFoo\nDeallocated\n" + - "Hello, World!\nKotlin says: Hello, everybody!\nHello from Kotlin\n2, 1\n" + - "true\ntrue\n" + - "Global string\nAnother global string\nnull\nglobal object\n" + - "5\n" + - "String macro\n" + - "CFString macro\n" + - "Deallocated\nDeallocated\n" + - "Class TestExportObjCClass34 has multiple implementations. Which one will be used is undefined.\n" - - if (isNoopGC) { - // No deallocations for the no-op GC. - goldValue = goldValue.replace("Deallocated\n", "") - } - + enabled = !isNoopGC source = "interop/objc/smoke.kt" interop = 'objcSmoke' - doBeforeBuild { mkdir(buildDir) execClangForCompilerTests(project.target) { @@ -4751,6 +4608,33 @@ if (PlatformInfo.isAppleTarget(project)) { into("$testOutputLocal/$name/$target/en.lproj/") } } + useGoldenData = true + } + + interopTest("interop_objc_smoke_noopgc") { + enabled = isNoopGC + source = "interop/objc/smoke_noopgc.kt" + interop = 'objcSmoke' + doBeforeBuild { + mkdir(buildDir) + execClangForCompilerTests(project.target) { + args "$projectDir/interop/objc/smoke.m" + args "-lobjc", '-fobjc-arc' + args '-fPIC', '-shared', '-o', "$buildDir/libobjcsmoke.dylib" + // Enable ARC optimizations to prevent some objects from leaking in Obj-C code due to exceptions: + args '-O2' + } + if (UtilsKt.isSimulatorTarget(project, project.target)) { + UtilsKt.codesign(project, "$buildDir/libobjcsmoke.dylib") + } + + copy { + from("interop/objc/Localizable.stringsdict") + into("$testOutputLocal/$name/$target/en.lproj/") + } + } + // No deallocations for the no-op GC. + useGoldenData = true } interopTestMultifile("interop_objc_tests") { @@ -4785,7 +4669,7 @@ if (PlatformInfo.isAppleTarget(project)) { } interopTest("interop_objc_global_initializer") { - goldValue = "OK\n" + useGoldenData = true source = "interop/objc_with_initializer/objc_test.kt" interop = 'objcMisc' @@ -4838,9 +4722,9 @@ if (PlatformInfo.isAppleTarget(project)) { } interopTest("interop_objc_foreignExceptionMode_wrap") { - source = "interop/objc/foreignException/objcExceptionMode.kt" + source = "interop/objc/foreignException/objcExceptionMode_wrap.kt" interop = 'foreignExceptionMode_wrap' - goldValue = "OK: ForeignException\n" + useGoldenData = true UtilsKt.dependsOnPlatformLibs(it) doBeforeBuild { @@ -4857,9 +4741,9 @@ if (PlatformInfo.isAppleTarget(project)) { } interopTest("interop_objc_foreignExceptionMode_default") { - source = "interop/objc/foreignException/objcExceptionMode.kt" + source = "interop/objc/foreignException/objcExceptionMode_default.kt" interop = 'foreignExceptionMode_default' - goldValue = "OK: Ends with uncaught exception handler\n" + useGoldenData = true UtilsKt.dependsOnPlatformLibs(it) doBeforeBuild { @@ -4878,7 +4762,7 @@ if (PlatformInfo.isAppleTarget(project)) { interopTest("interop_objc_kt34467") { source = "interop/objc/kt34467/foo.kt" interop = 'objcKt34467' - goldValue = "OK\n42\n" + useGoldenData = true } interopTest("interop_objc_illegal_sharing_with_weak") { @@ -4887,7 +4771,7 @@ if (PlatformInfo.isAppleTarget(project)) { if (isExperimentalMM) { // Experimental MM supports arbitrary object sharing. - goldValue = "Before\nAfter true\n" + outputChecker = { it == "Before\nAfter true\n" } } else { expectedExitStatusChecker = { it != 0 } outputChecker = { @@ -4903,7 +4787,7 @@ if (PlatformInfo.isAppleTarget(project)) { source = "interop/objc/kt42172/main.kt" interop = "objc_kt42172" flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative'] - goldValue = 'Executed finalizer\n' + useGoldenData = true doBeforeBuild { mkdir(buildDir) @@ -4927,7 +4811,7 @@ if (PlatformInfo.isAppleTarget(project)) { } } source = "interop/objc_arc_contract/main.kt" - goldValue = "ok\n" + useGoldenData = true flags = ["-native-library", "$buildDir/objc_arc_contract.bc"] } } @@ -4942,7 +4826,7 @@ standaloneTest("jsinterop_math") { } dependsOn ':kotlin-native:wasm32PlatformLibs' enabled = (project.testTarget == 'wasm32') - goldValue = "e = 2.718281828459045, pi = 3.141592653589793, sin(pi) = 1.2246467991473532E-16, sin(pi/2) = 1.0, ln(1) = 0.0, ln(e) = 1.0\n" + useGoldenData = true source = "jsinterop/math.kt" flags = ["-r", "$buildDir", "-l", "jsmath"] } @@ -4950,14 +4834,14 @@ standaloneTest("jsinterop_math") { standaloneTest("interop_libiconv") { enabled = (project.testTarget == null) source = "interop/libiconv.kt" - goldValue = "72 72\n101 101\n108 108\n108 108\n111 111\n33 33\n" + useGoldenData = true UtilsKt.dependsOnPlatformLibs(it) } standaloneTest("interop_zlib") { enabled = (project.testTarget == null) source = "interop/platform_zlib.kt" - goldValue = "Hello!\nHello!\n" + useGoldenData = true UtilsKt.dependsOnPlatformLibs(it) } @@ -4981,39 +4865,14 @@ dynamicTest("produce_dynamic") { disabled = (project.target.name != project.hostName) source = "produce_dynamic/simple/hello.kt" cSource = "$projectDir/produce_dynamic/simple/main.c" - goldValue = "Hello, dynamic!\n" + - "Base.foo\n" + - "Base.fooParam: a 1 q\n" + - "Child.fooParam: b 2 null\n" + - "Child.fooParam: c 3 null\n" + - "Impl1.I: d 4 Impl1\n" + - "Impl2.I: e 5 Impl2\n" + - "String is Kotlin/Native nullable is Hi null is OK\n" + - "RO property is 42\n" + - "RW property is 239\n" + - "enum100 = 100\n" + - "enum42 = 42\n" + - "object = 42\n" + - "singleton = I am single\n" + - "mutable = foo\n" + - "topLevel = 777 3\n" + - "IsInstance1 = PASS\n" + - "IsInstance2 = PASS\n" + - "getVector128 = (1, 2, 3, 4)\n" + - "Error handler: kotlin.Error: Expected error\n" + useGoldenData = true } dynamicTest("kt36639") { disabled = (project.target.name != project.hostName) source = "produce_dynamic/kt-36639/main.kt" cSource = "$projectDir/produce_dynamic/kt-36639/main.c" - goldValue = """|CFoo1::extfoo - |CFoo1::extfoo - |CFoo2::extfoo - |CFoo2::extfoo - |Int::extfoo - |Int::extfoo - |""".stripMargin() + useGoldenData = true } for (i in 0..2) { @@ -5022,7 +4881,7 @@ for (i in 0..2) { disabled = (project.target.name != project.hostName) source = "produce_dynamic/kt-42796/main-${i}.kt" cSource = "$projectDir/produce_dynamic/kt-42796/main.cpp" - goldValue = "" + useGoldenData = true clangFlags = ["-DTEST=$i", "-Werror"] } } @@ -5043,8 +4902,7 @@ dynamicTest("interop_concurrentRuntime") { source = "interop/concurrentTerminate/reverseInterop.kt" cSource = "$projectDir/interop/concurrentTerminate/main.cpp" clangTool = "clang++" - goldValue = "Uncaught Kotlin exception: kotlin.RuntimeException: Example" - outputChecker = { str -> str.startsWith(goldValue) } + outputChecker = { str -> str.startsWith("Uncaught Kotlin exception: kotlin.RuntimeException: Example") } expectedExitStatus = 99 } @@ -5060,7 +4918,7 @@ dynamicTest("interop_cleaners_main_thread") { source = "interop/cleaners/cleaners.kt" cSource = "$projectDir/interop/cleaners/main_thread.cpp" clangTool = "clang++" - goldValue = "42\n" + useGoldenData = true flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative'] } @@ -5069,7 +4927,7 @@ dynamicTest("interop_cleaners_second_thread") { source = "interop/cleaners/cleaners.kt" cSource = "$projectDir/interop/cleaners/second_thread.cpp" clangTool = "clang++" - goldValue = "42\n" + useGoldenData = true flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative'] } @@ -5078,7 +4936,7 @@ dynamicTest("interop_cleaners_leak") { source = "interop/cleaners/cleaners.kt" cSource = "$projectDir/interop/cleaners/leak.cpp" clangTool = "clang++" - goldValue = "" + useGoldenData = true flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative'] } @@ -5154,10 +5012,10 @@ tasks.register("library_mismatch", KonanDriverTest) { "warning: skipping $dir/1.2/empty.klib. The library versions don't match. Expected '5.6', found '1.2'\n" + //"warning: skipping $dir/3.4/empty.klib. The target doesn't match. Expected '$currentTarget', found [$someOtherTarget]\n" + "Hello, versioned world!\n" - goldValue = PlatformInfo.isWindows() ? messages.replaceAll('\\/', '\\\\') : messages + messages = PlatformInfo.isWindows() ? messages.replaceAll('\\/', '\\\\') : messages outputChecker = { out -> def outV = out.split("\n").findAll{ !it.startsWith("WARNING: ") }.join("\n") - goldValue.split("\n") + messages.split("\n") .collect { line -> outV.contains(line) } .every { it == true } } @@ -5178,12 +5036,10 @@ tasks.register("library_ir_provider_mismatch", KonanDriverTest) { source = "link/ir_providers/hello.kt" flags = ['-target', currentTarget, '-l', 'empty', '-r', "$dir/unsupported_ir_provider", '-r', "$dir/supported_ir_provider"] compilerMessages = true - def messages = - "warning: skipping $dir/unsupported_ir_provider/empty.klib. The library requires unknown IR provider UNSUPPORTED.\n" + - "hello\n" - goldValue = PlatformInfo.isWindows() ? messages.replaceAll('\\/', '\\\\') : messages + def messages = "warning: skipping $dir/unsupported_ir_provider/empty.klib. The library requires unknown IR provider UNSUPPORTED.\nhello\n" + messages = PlatformInfo.isWindows() ? messages.replaceAll('\\/', '\\\\') : messages outputChecker = { out -> - goldValue.split("\n") + messages.split("\n") .collect { line -> out.contains(line) } .every { it == true } } @@ -5200,26 +5056,26 @@ standaloneTest("fake_override_0") { } source = "$sources/main.kt" flags = ["-l", "use", "-r", "$dir"] - goldValue = "Moved\nMoved\nChild\nSuper\n" + useGoldenData = true } linkTest("private_fake_overrides_0") { source = "link/private_fake_overrides/inherit_main.kt" lib = "link/private_fake_overrides/inherit_lib.kt" - goldValue = "PASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\n" + useGoldenData = true } linkTest("private_fake_overrides_1") { source = "link/private_fake_overrides/override_main.kt" lib = "link/private_fake_overrides/override_lib.kt" - goldValue = "PASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\nPASS\n" + useGoldenData = true } linkTest("remap_expect_property_refs") { source = "codegen/mpp/remap_expect_property_ref_main.kt" lib = "codegen/mpp/remap_expect_property_ref_lib.kt" flags = ["-Xmulti-platform"] - goldValue = "42\n" + useGoldenData = true } Task frameworkTest(String name, Closure configurator) { @@ -5620,12 +5476,7 @@ tasks.register("metadata_compare_unable_to_import", MetadataComparisonTest) { standaloneTest("local_ea_arraysfieldwrite") { disabled = (cacheTesting != null) // Cache is not compatible with -opt. - goldValue = "Array (constructor init):\nSize: 2\nContents: [1, 2]\n" + - "Array (constructor init):\nSize: 2\nContents: [3, 4]\n" + - "Array (default value init):\nSize: 2\nContents: [1, 2]\n" + - "Array (default value init):\nSize: 2\nContents: [3, 4]\n" + - "Array (init block):\nSize: 2\nContents: [1, 2]\n" + - "Array (init block):\nSize: 2\nContents: [3, 4]\n" + useGoldenData = true flags = ["-opt"] source = "codegen/localEscapeAnalysis/arraysFieldWrite.kt" } @@ -5641,12 +5492,9 @@ tasks.register("override_konan_properties0", KonanDriverTest) { ] compilerMessages = true source = "link/ir_providers/hello.kt" - def messages = - "inline_threshold: 76\n" + - "hello\n" - goldValue = PlatformInfo.isWindows() ? messages.replaceAll('\\/', '\\\\') : messages + def messages = "inline_threshold: 76\nhello\n" outputChecker = { out -> - goldValue.split("\n") + messages.split("\n") .collect { line -> out.contains(line) } .every { it == true } } @@ -5854,3 +5702,5 @@ if (UtilsKt.supportsRunningTestsOnDevice(target)) { } .configureEach { it.enabled = false } } + + diff --git a/kotlin-native/backend.native/tests/codegen/basics/canonical_name.out b/kotlin-native/backend.native/tests/codegen/basics/canonical_name.out new file mode 100644 index 00000000000..b25c0908bfb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/canonical_name.out @@ -0,0 +1,2 @@ +A:foo +A:qux diff --git a/kotlin-native/backend.native/tests/codegen/basics/cast_null.out b/kotlin-native/backend.native/tests/codegen/basics/cast_null.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/cast_null.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/basics/check_type.out b/kotlin-native/backend.native/tests/codegen/basics/check_type.out new file mode 100644 index 00000000000..f98a79c5b6f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/check_type.out @@ -0,0 +1,6 @@ +true +false +true +true +true +true diff --git a/kotlin-native/backend.native/tests/codegen/basics/concatenation.out b/kotlin-native/backend.native/tests/codegen/basics/concatenation.out new file mode 100644 index 00000000000..2aafe150106 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/concatenation.out @@ -0,0 +1,3 @@ +Hello world 1 2 +Hello, a +Hello, b diff --git a/kotlin-native/backend.native/tests/codegen/basics/expression_as_statement.out b/kotlin-native/backend.native/tests/codegen/basics/expression_as_statement.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/expression_as_statement.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/basics/safe_cast.out b/kotlin-native/backend.native/tests/codegen/basics/safe_cast.out new file mode 100644 index 00000000000..28a70785dea --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/safe_cast.out @@ -0,0 +1,2 @@ +safe_cast_positive: true +safe_cast_negative: true diff --git a/kotlin-native/backend.native/tests/codegen/basics/spread_operator_0.out b/kotlin-native/backend.native/tests/codegen/basics/spread_operator_0.out new file mode 100644 index 00000000000..0bb4cc104b2 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/spread_operator_0.out @@ -0,0 +1 @@ +[K, o, t, l, i, n, , i, s, , c, o, o, l, , l, a, n, g, u, a, g, e] diff --git a/kotlin-native/backend.native/tests/codegen/basics/superFunCall.out b/kotlin-native/backend.native/tests/codegen/basics/superFunCall.out new file mode 100644 index 00000000000..db5d36681fd --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/superFunCall.out @@ -0,0 +1,2 @@ + + diff --git a/kotlin-native/backend.native/tests/codegen/basics/superGetterCall.out b/kotlin-native/backend.native/tests/codegen/basics/superGetterCall.out new file mode 100644 index 00000000000..f7fa5a233a9 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/superGetterCall.out @@ -0,0 +1,2 @@ + + diff --git a/kotlin-native/backend.native/tests/codegen/basics/superSetterCall.out b/kotlin-native/backend.native/tests/codegen/basics/superSetterCall.out new file mode 100644 index 00000000000..ad01a64ad11 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/superSetterCall.out @@ -0,0 +1,2 @@ +zzz +zzz diff --git a/kotlin-native/backend.native/tests/codegen/basics/typealias1.out b/kotlin-native/backend.native/tests/codegen/basics/typealias1.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/typealias1.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast1.out b/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast1.out new file mode 100644 index 00000000000..270e65c0f2e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast1.out @@ -0,0 +1,4 @@ +17 +17 +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast2.out b/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast2.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast2.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast3.out b/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast3.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast3.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast4.out b/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast4.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/unchecked_cast4.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/basics/unit1.out b/kotlin-native/backend.native/tests/codegen/basics/unit1.out new file mode 100644 index 00000000000..dcac34d859d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/unit1.out @@ -0,0 +1,2 @@ +First +kotlin.Unit diff --git a/kotlin-native/backend.native/tests/codegen/basics/unit2.out b/kotlin-native/backend.native/tests/codegen/basics/unit2.out new file mode 100644 index 00000000000..0fd40fc5055 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/unit2.out @@ -0,0 +1 @@ +kotlin.Unit diff --git a/kotlin-native/backend.native/tests/codegen/basics/unit3.out b/kotlin-native/backend.native/tests/codegen/basics/unit3.out new file mode 100644 index 00000000000..0fd40fc5055 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/unit3.out @@ -0,0 +1 @@ +kotlin.Unit diff --git a/kotlin-native/backend.native/tests/codegen/basics/unit4.out b/kotlin-native/backend.native/tests/codegen/basics/unit4.out new file mode 100644 index 00000000000..a965a70ed4e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/basics/unit4.out @@ -0,0 +1 @@ +Done diff --git a/kotlin-native/backend.native/tests/codegen/boxing/box_cache0.out b/kotlin-native/backend.native/tests/codegen/boxing/box_cache0.out new file mode 100644 index 00000000000..9ff26981101 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/box_cache0.out @@ -0,0 +1,6 @@ +2 +256 +256 +256 +256 +256 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing0.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing0.out new file mode 100644 index 00000000000..98d9bcb75a6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing0.out @@ -0,0 +1 @@ +17 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing1.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing1.out new file mode 100644 index 00000000000..3e2003b20c2 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing1.out @@ -0,0 +1,3 @@ +1 +false +Hello diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing10.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing10.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing10.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing11.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing11.out new file mode 100644 index 00000000000..c4a9d141e4b --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing11.out @@ -0,0 +1,2 @@ +17 +42 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing12.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing12.out new file mode 100644 index 00000000000..3c032078a4a --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing12.out @@ -0,0 +1 @@ +18 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing13.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing13.out new file mode 100644 index 00000000000..d3e48b55722 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing13.out @@ -0,0 +1,6 @@ +false +false +true +true +false +false diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing14.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing14.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing14.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing15.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing15.out new file mode 100644 index 00000000000..98d9bcb75a6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing15.out @@ -0,0 +1 @@ +17 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing2.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing2.out new file mode 100644 index 00000000000..1171a5b5384 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing2.out @@ -0,0 +1,3 @@ +1 +true +other diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing3.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing3.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing3.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing4.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing4.out new file mode 100644 index 00000000000..b6a7d89c68e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing4.out @@ -0,0 +1 @@ +16 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing5.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing5.out new file mode 100644 index 00000000000..ef5d1a8685d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing5.out @@ -0,0 +1,2 @@ +16 +42 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing6.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing6.out new file mode 100644 index 00000000000..5174adaee24 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing6.out @@ -0,0 +1,2 @@ +42 +16 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing7.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing7.out new file mode 100644 index 00000000000..b261da18d51 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing7.out @@ -0,0 +1,2 @@ +1 +0 diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing8.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing8.out new file mode 100644 index 00000000000..f0084dc294f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing8.out @@ -0,0 +1,4 @@ +1 +null +true +Hello diff --git a/kotlin-native/backend.native/tests/codegen/boxing/boxing9.out b/kotlin-native/backend.native/tests/codegen/boxing/boxing9.out new file mode 100644 index 00000000000..d335bb41a7b --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/boxing/boxing9.out @@ -0,0 +1,9 @@ +1 +null +true +Hello +2 +null +true +Hello +3 diff --git a/kotlin-native/backend.native/tests/codegen/branching/when8.out b/kotlin-native/backend.native/tests/codegen/branching/when8.out new file mode 100644 index 00000000000..27ba77ddaf6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/branching/when8.out @@ -0,0 +1 @@ +true diff --git a/kotlin-native/backend.native/tests/codegen/branching/when9.out b/kotlin-native/backend.native/tests/codegen/branching/when9.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/branching/when9.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/branching/when_with_try1.out b/kotlin-native/backend.native/tests/codegen/branching/when_with_try1.out new file mode 100644 index 00000000000..a2bc2c3a6b5 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/branching/when_with_try1.out @@ -0,0 +1,3 @@ +null +null +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/linkTest2_main.out b/kotlin-native/backend.native/tests/codegen/bridges/linkTest2_main.out new file mode 100644 index 00000000000..27ba77ddaf6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/linkTest2_main.out @@ -0,0 +1 @@ +true diff --git a/kotlin-native/backend.native/tests/codegen/bridges/linkTest_main.out b/kotlin-native/backend.native/tests/codegen/bridges/linkTest_main.out new file mode 100644 index 00000000000..bda709ecfb4 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/linkTest_main.out @@ -0,0 +1,3 @@ +42 +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/special.out b/kotlin-native/backend.native/tests/codegen/bridges/special.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/special.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test0.out b/kotlin-native/backend.native/tests/codegen/bridges/test0.out new file mode 100644 index 00000000000..daaac9e3030 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test0.out @@ -0,0 +1,2 @@ +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test1.out b/kotlin-native/backend.native/tests/codegen/bridges/test1.out new file mode 100644 index 00000000000..e3c00fddd36 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test1.out @@ -0,0 +1 @@ +1042 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test10.out b/kotlin-native/backend.native/tests/codegen/bridges/test10.out new file mode 100644 index 00000000000..daaac9e3030 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test10.out @@ -0,0 +1,2 @@ +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test11.out b/kotlin-native/backend.native/tests/codegen/bridges/test11.out new file mode 100644 index 00000000000..bda709ecfb4 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test11.out @@ -0,0 +1,3 @@ +42 +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test12.out b/kotlin-native/backend.native/tests/codegen/bridges/test12.out new file mode 100644 index 00000000000..6b31c5bd07f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test12.out @@ -0,0 +1,2 @@ +B: 42 +C: 42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test13.out b/kotlin-native/backend.native/tests/codegen/bridges/test13.out new file mode 100644 index 00000000000..daaac9e3030 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test13.out @@ -0,0 +1,2 @@ +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test14.out b/kotlin-native/backend.native/tests/codegen/bridges/test14.out new file mode 100644 index 00000000000..c87ec05715d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test14.out @@ -0,0 +1,8 @@ +42 +56 +42 +56 +56 +42 +156 +142 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test15.out b/kotlin-native/backend.native/tests/codegen/bridges/test15.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test15.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test16.out b/kotlin-native/backend.native/tests/codegen/bridges/test16.out new file mode 100644 index 00000000000..2c94e483710 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test16.out @@ -0,0 +1,2 @@ +OK +OK diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test17.out b/kotlin-native/backend.native/tests/codegen/bridges/test17.out new file mode 100644 index 00000000000..8fb8a08e3f9 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test17.out @@ -0,0 +1,4 @@ +42 +42 +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test18.out b/kotlin-native/backend.native/tests/codegen/bridges/test18.out new file mode 100644 index 00000000000..0fd40fc5055 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test18.out @@ -0,0 +1 @@ +kotlin.Unit diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test2.out b/kotlin-native/backend.native/tests/codegen/bridges/test2.out new file mode 100644 index 00000000000..daaac9e3030 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test2.out @@ -0,0 +1,2 @@ +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test3.out b/kotlin-native/backend.native/tests/codegen/bridges/test3.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test3.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test4.out b/kotlin-native/backend.native/tests/codegen/bridges/test4.out new file mode 100644 index 00000000000..daaac9e3030 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test4.out @@ -0,0 +1,2 @@ +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test5.out b/kotlin-native/backend.native/tests/codegen/bridges/test5.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test5.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test6.out b/kotlin-native/backend.native/tests/codegen/bridges/test6.out new file mode 100644 index 00000000000..08adcfe27a1 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test6.out @@ -0,0 +1,5 @@ +42 +42 +42 +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test7.out b/kotlin-native/backend.native/tests/codegen/bridges/test7.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test7.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test8.out b/kotlin-native/backend.native/tests/codegen/bridges/test8.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test8.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/bridges/test9.out b/kotlin-native/backend.native/tests/codegen/bridges/test9.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/bridges/test9.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/classDelegation/generic.out b/kotlin-native/backend.native/tests/codegen/classDelegation/generic.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/classDelegation/generic.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/classDelegation/linkTest_main.out b/kotlin-native/backend.native/tests/codegen/classDelegation/linkTest_main.out new file mode 100644 index 00000000000..e90ecd27d28 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/classDelegation/linkTest_main.out @@ -0,0 +1,5 @@ +qxx +123 +42 +117 +zzz diff --git a/kotlin-native/backend.native/tests/codegen/classDelegation/method.out b/kotlin-native/backend.native/tests/codegen/classDelegation/method.out new file mode 100644 index 00000000000..d65874ef665 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/classDelegation/method.out @@ -0,0 +1 @@ +OKOK diff --git a/kotlin-native/backend.native/tests/codegen/classDelegation/property.out b/kotlin-native/backend.native/tests/codegen/classDelegation/property.out new file mode 100644 index 00000000000..36fade77193 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/classDelegation/property.out @@ -0,0 +1 @@ +4242 diff --git a/kotlin-native/backend.native/tests/codegen/classDelegation/withBridge.out b/kotlin-native/backend.native/tests/codegen/classDelegation/withBridge.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/classDelegation/withBridge.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/break.out b/kotlin-native/backend.native/tests/codegen/controlflow/break.out new file mode 100644 index 00000000000..678d6620e61 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/break.out @@ -0,0 +1,12 @@ +foo@l1 +foo@l2 +foo@l2 +foo@l2 +bar@l1 +bar@l2 +bar@l2 +bar@l2 +qux@t1 +qux@l2 +qux@l2 +qux@l2 diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/break1.out b/kotlin-native/backend.native/tests/codegen/controlflow/break1.out new file mode 100644 index 00000000000..733adc12a15 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/break1.out @@ -0,0 +1,2 @@ +Body +Done diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops.out new file mode 100644 index 00000000000..395ee50dde4 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops.out @@ -0,0 +1,16 @@ +01234 +0123 +43210 + +024 +02 +420 + +036 +03 +630 + +024 +02 +420 + diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array.out new file mode 100644 index 00000000000..f8097b81672 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array.out @@ -0,0 +1,4 @@ +4035 + +0 +0 diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_break_continue.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_break_continue.out new file mode 100644 index 00000000000..47683305fa8 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_break_continue.out @@ -0,0 +1,2 @@ +403 + diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_indices.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_indices.out new file mode 100644 index 00000000000..1f615173db1 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_indices.out @@ -0,0 +1,2 @@ +0123 + diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_mutation.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_mutation.out new file mode 100644 index 00000000000..a2113715a3e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_mutation.out @@ -0,0 +1 @@ +4000 \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_nested.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_nested.out new file mode 100644 index 00000000000..0db872924d0 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_nested.out @@ -0,0 +1,4 @@ +123 +Hello + +12345678910 diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_nullable.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_nullable.out new file mode 100644 index 00000000000..d800886d9c8 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_nullable.out @@ -0,0 +1 @@ +123 \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_side_effects.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_side_effects.out new file mode 100644 index 00000000000..715b12aaa4c --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_array_side_effects.out @@ -0,0 +1,4 @@ +side-effect +4035 +side-effect + diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_call_order.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_call_order.out new file mode 100644 index 00000000000..3f9e4e21407 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_call_order.out @@ -0,0 +1,3 @@ +1234 +1234 +2134 diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_coroutines.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_coroutines.out new file mode 100644 index 00000000000..b4abc699731 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_coroutines.out @@ -0,0 +1,5 @@ +before: 0 after: 0 +before: 2 after: 2 +before: 4 after: 4 +before: 6 after: 6 +Got: 0 2 4 6 diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_empty_range.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_empty_range.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_empty_range.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_errors.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_errors.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_errors.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_let_with_nullable.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_let_with_nullable.out new file mode 100644 index 00000000000..232bc84ace1 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_let_with_nullable.out @@ -0,0 +1,27 @@ +012345 +012345 +024 +01234 +01234 +024 +543210 +543210 +531 +012345 +012345 +024 +01234 +01234 +024 +543210 +543210 +531 +abcdef +abcdef +ace +abcde +abcde +ace +fedcba +fedcba +fdb diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_nested.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_nested.out new file mode 100644 index 00000000000..9d213d78e37 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_nested.out @@ -0,0 +1,7 @@ +00 01 02 10 11 12 20 21 22 +00 01 10 11 20 21 +00 01 10 11 20 21 +00 01 +00 02 10 12 20 22 +00 02 10 12 20 22 +00 10 20 diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_overflow.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_overflow.out new file mode 100644 index 00000000000..2d5fd1ab349 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_overflow.out @@ -0,0 +1,4 @@ +2147483646 2147483647 +2147483646 +-2147483647 -2147483648 +1073741827 diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_types.out b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_types.out new file mode 100644 index 00000000000..ef2c62e6237 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/for_loops_types.out @@ -0,0 +1,102 @@ +01234 +01234 +01234 +01234 +01234 +01234 +01234 +01234 +01234 +01234 +01234 +01234 +01234 +01234 +01234 +01234 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +0123 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +43210 +abcd +abc +dcba +024 +024 +024 +024 +024 +024 +024 +024 +024 +024 +024 +024 +024 +024 +024 +024 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +420 +420 +420 +420 +420 +420 +420 +420 +420 +420 +420 +420 +420 +420 +420 +420 +ac +ac +db diff --git a/kotlin-native/backend.native/tests/codegen/controlflow/unreachable1.out b/kotlin-native/backend.native/tests/codegen/controlflow/unreachable1.out new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/controlflow/unreachable1.out @@ -0,0 +1 @@ +1 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/anonymousObject.out b/kotlin-native/backend.native/tests/codegen/coroutines/anonymousObject.out new file mode 100644 index 00000000000..b1a17ba1369 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/anonymousObject.out @@ -0,0 +1 @@ +zzz diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally1.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally1.out new file mode 100644 index 00000000000..7dd6de5b410 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally1.out @@ -0,0 +1,3 @@ +f1 +s1 +117 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally2.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally2.out new file mode 100644 index 00000000000..7dd6de5b410 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally2.out @@ -0,0 +1,3 @@ +f1 +s1 +117 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally3.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally3.out new file mode 100644 index 00000000000..7dd6de5b410 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally3.out @@ -0,0 +1,3 @@ +f1 +s1 +117 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally4.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally4.out new file mode 100644 index 00000000000..88f401cf394 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally4.out @@ -0,0 +1,3 @@ +s1 +finally +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally5.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally5.out new file mode 100644 index 00000000000..42ed6256650 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally5.out @@ -0,0 +1,4 @@ +s1 +f2 +finally +1 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally6.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally6.out new file mode 100644 index 00000000000..c7aa0114a50 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally6.out @@ -0,0 +1,4 @@ +s1 +finally +error +0 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally7.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally7.out new file mode 100644 index 00000000000..cee098de202 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_finally7.out @@ -0,0 +1,6 @@ +s1 +f2 +finally1 +s2 +finally2 +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_if1.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_if1.out new file mode 100644 index 00000000000..29b24620084 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_if1.out @@ -0,0 +1,4 @@ +f1 +s1 +f3 +84 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_if2.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_if2.out new file mode 100644 index 00000000000..6afbb351959 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_if2.out @@ -0,0 +1,4 @@ +f1 +s1 +f2 +43 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_inline1.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_inline1.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_inline1.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_inline2.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_inline2.out new file mode 100644 index 00000000000..8b837844a05 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_inline2.out @@ -0,0 +1,2 @@ +s1 +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_inline3.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_inline3.out new file mode 100644 index 00000000000..1bc6efd249e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_inline3.out @@ -0,0 +1,3 @@ +f1 +s1 +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch1.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch1.out new file mode 100644 index 00000000000..8b837844a05 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch1.out @@ -0,0 +1,2 @@ +s1 +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch2.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch2.out new file mode 100644 index 00000000000..8b837844a05 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch2.out @@ -0,0 +1,2 @@ +s1 +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch3.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch3.out new file mode 100644 index 00000000000..a7413bde36b --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch3.out @@ -0,0 +1,3 @@ +s2 +f2 +1 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch4.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch4.out new file mode 100644 index 00000000000..a7413bde36b --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch4.out @@ -0,0 +1,3 @@ +s2 +f2 +1 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch5.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch5.out new file mode 100644 index 00000000000..39812c11bf8 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_tryCatch5.out @@ -0,0 +1,4 @@ +s2 +s1 +Error +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_while1.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_while1.out new file mode 100644 index 00000000000..55f6b4ed27c --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_while1.out @@ -0,0 +1,5 @@ +s3 +s3 +s3 +s3 +3 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_while2.out b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_while2.out new file mode 100644 index 00000000000..b882ed8cf03 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/controlFlow_while2.out @@ -0,0 +1,4 @@ +s3 +s3 +s3 +3 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/coroutineContext1.out b/kotlin-native/backend.native/tests/codegen/coroutines/coroutineContext1.out new file mode 100644 index 00000000000..226b070bb28 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/coroutineContext1.out @@ -0,0 +1 @@ +EmptyCoroutineContext diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/coroutineContext2.out b/kotlin-native/backend.native/tests/codegen/coroutines/coroutineContext2.out new file mode 100644 index 00000000000..226b070bb28 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/coroutineContext2.out @@ -0,0 +1 @@ +EmptyCoroutineContext diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/correctOrder1.out b/kotlin-native/backend.native/tests/codegen/coroutines/correctOrder1.out new file mode 100644 index 00000000000..025d917d9b7 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/correctOrder1.out @@ -0,0 +1,4 @@ +f1 +s1 +f2 +160 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/degenerate1.out b/kotlin-native/backend.native/tests/codegen/coroutines/degenerate1.out new file mode 100644 index 00000000000..655c6e645cc --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/degenerate1.out @@ -0,0 +1 @@ +s1 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/degenerate2.out b/kotlin-native/backend.native/tests/codegen/coroutines/degenerate2.out new file mode 100644 index 00000000000..7d52dbf7e90 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/degenerate2.out @@ -0,0 +1,2 @@ +s2 +s1 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_eqeq_name.out b/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_eqeq_name.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_invokeAsFunction.out b/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_invokeAsFunction.out new file mode 100644 index 00000000000..3f7d1915f71 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_invokeAsFunction.out @@ -0,0 +1 @@ +159 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_lambdaAsSuspendLambda.out b/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_lambdaAsSuspendLambda.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_simple.out b/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_simple.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/functionReference_simple.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/kt41394.out b/kotlin-native/backend.native/tests/codegen/coroutines/kt41394.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/returnsNothing1.out b/kotlin-native/backend.native/tests/codegen/coroutines/returnsNothing1.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/returnsNothing1.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/returnsUnit1.out b/kotlin-native/backend.native/tests/codegen/coroutines/returnsUnit1.out new file mode 100644 index 00000000000..4dc5a1f0c0a --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/returnsUnit1.out @@ -0,0 +1,3 @@ +117 +s1 +0 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/simple.out b/kotlin-native/backend.native/tests/codegen/coroutines/simple.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/simple.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/suspendConversion.out b/kotlin-native/backend.native/tests/codegen/coroutines/suspendConversion.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/codegen/coroutines/withReceiver.out b/kotlin-native/backend.native/tests/codegen/coroutines/withReceiver.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/coroutines/withReceiver.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/dataflow/scope1.out b/kotlin-native/backend.native/tests/codegen/dataflow/scope1.out new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/dataflow/scope1.out @@ -0,0 +1 @@ +1 diff --git a/kotlin-native/backend.native/tests/codegen/dataflow/uninitialized_val.out b/kotlin-native/backend.native/tests/codegen/dataflow/uninitialized_val.out new file mode 100644 index 00000000000..1191247b6d9 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/dataflow/uninitialized_val.out @@ -0,0 +1,2 @@ +1 +2 diff --git a/kotlin-native/backend.native/tests/codegen/delegatedProperty/correctFieldsOrder_main.out b/kotlin-native/backend.native/tests/codegen/delegatedProperty/correctFieldsOrder_main.out new file mode 100644 index 00000000000..ccb68181a4e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/delegatedProperty/correctFieldsOrder_main.out @@ -0,0 +1,4 @@ +qxx +117 +zzz +qzz diff --git a/kotlin-native/backend.native/tests/codegen/delegatedProperty/delegatedOverride_main.out b/kotlin-native/backend.native/tests/codegen/delegatedProperty/delegatedOverride_main.out new file mode 100644 index 00000000000..6a95e9efa88 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/delegatedProperty/delegatedOverride_main.out @@ -0,0 +1,4 @@ +156 +x +117 +42 diff --git a/kotlin-native/backend.native/tests/codegen/delegatedProperty/lazy.out b/kotlin-native/backend.native/tests/codegen/delegatedProperty/lazy.out new file mode 100644 index 00000000000..6208f6d40ab --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/delegatedProperty/lazy.out @@ -0,0 +1,3 @@ +computed! +Hello +Hello diff --git a/kotlin-native/backend.native/tests/codegen/delegatedProperty/local.out b/kotlin-native/backend.native/tests/codegen/delegatedProperty/local.out new file mode 100644 index 00000000000..c91a42733d9 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/delegatedProperty/local.out @@ -0,0 +1,2 @@ +x +42 diff --git a/kotlin-native/backend.native/tests/codegen/delegatedProperty/map.out b/kotlin-native/backend.native/tests/codegen/delegatedProperty/map.out new file mode 100644 index 00000000000..4dcbcb19aad --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/delegatedProperty/map.out @@ -0,0 +1,2 @@ +John Doe +25 diff --git a/kotlin-native/backend.native/tests/codegen/delegatedProperty/observable.out b/kotlin-native/backend.native/tests/codegen/delegatedProperty/observable.out new file mode 100644 index 00000000000..2487ebcd7be --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/delegatedProperty/observable.out @@ -0,0 +1,2 @@ + -> first +first -> second diff --git a/kotlin-native/backend.native/tests/codegen/delegatedProperty/packageLevel.out b/kotlin-native/backend.native/tests/codegen/delegatedProperty/packageLevel.out new file mode 100644 index 00000000000..c91a42733d9 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/delegatedProperty/packageLevel.out @@ -0,0 +1,2 @@ +x +42 diff --git a/kotlin-native/backend.native/tests/codegen/delegatedProperty/simpleVal.out b/kotlin-native/backend.native/tests/codegen/delegatedProperty/simpleVal.out new file mode 100644 index 00000000000..c91a42733d9 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/delegatedProperty/simpleVal.out @@ -0,0 +1,2 @@ +x +42 diff --git a/kotlin-native/backend.native/tests/codegen/delegatedProperty/simpleVar.out b/kotlin-native/backend.native/tests/codegen/delegatedProperty/simpleVar.out new file mode 100644 index 00000000000..06f0023c3c4 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/delegatedProperty/simpleVar.out @@ -0,0 +1,5 @@ +get x +42 +set x +get x +117 diff --git a/kotlin-native/backend.native/tests/codegen/devirtualization/anonymousObject.out b/kotlin-native/backend.native/tests/codegen/devirtualization/anonymousObject.out new file mode 100644 index 00000000000..b1a17ba1369 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/devirtualization/anonymousObject.out @@ -0,0 +1 @@ +zzz diff --git a/kotlin-native/backend.native/tests/codegen/devirtualization/getter_looking_as_box_function.out b/kotlin-native/backend.native/tests/codegen/devirtualization/getter_looking_as_box_function.out new file mode 100644 index 00000000000..d591a2710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/devirtualization/getter_looking_as_box_function.out @@ -0,0 +1 @@ +box diff --git a/kotlin-native/backend.native/tests/codegen/devirtualization/lateinitInterface.out b/kotlin-native/backend.native/tests/codegen/devirtualization/lateinitInterface.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/devirtualization/lateinitInterface.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/enum/companionObject.out b/kotlin-native/backend.native/tests/codegen/enum/companionObject.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/companionObject.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/enum/interfaceCallNoEntryClass.out b/kotlin-native/backend.native/tests/codegen/enum/interfaceCallNoEntryClass.out new file mode 100644 index 00000000000..fdaa745843e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/interfaceCallNoEntryClass.out @@ -0,0 +1,2 @@ +('z3', 3) +('z3', 3) diff --git a/kotlin-native/backend.native/tests/codegen/enum/interfaceCallWithEntryClass.out b/kotlin-native/backend.native/tests/codegen/enum/interfaceCallWithEntryClass.out new file mode 100644 index 00000000000..2b4991e4674 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/interfaceCallWithEntryClass.out @@ -0,0 +1,2 @@ +z1z2 +z1z2 diff --git a/kotlin-native/backend.native/tests/codegen/enum/lambdaInDefault.out b/kotlin-native/backend.native/tests/codegen/enum/lambdaInDefault.out new file mode 100644 index 00000000000..73c52c3e3cf --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/lambdaInDefault.out @@ -0,0 +1 @@ +Q diff --git a/kotlin-native/backend.native/tests/codegen/enum/linkTest_main.out b/kotlin-native/backend.native/tests/codegen/enum/linkTest_main.out new file mode 100644 index 00000000000..6a476d9c6b4 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/linkTest_main.out @@ -0,0 +1,3 @@ +42 +117 +-1 diff --git a/kotlin-native/backend.native/tests/codegen/enum/loop.out b/kotlin-native/backend.native/tests/codegen/enum/loop.out new file mode 100644 index 00000000000..b0b80f3442f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/loop.out @@ -0,0 +1,2 @@ +Z +Z diff --git a/kotlin-native/backend.native/tests/codegen/enum/nested.out b/kotlin-native/backend.native/tests/codegen/enum/nested.out new file mode 100644 index 00000000000..8ec30d8fdd0 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/nested.out @@ -0,0 +1,2 @@ +A +C diff --git a/kotlin-native/backend.native/tests/codegen/enum/switchLowering.out b/kotlin-native/backend.native/tests/codegen/enum/switchLowering.out new file mode 100644 index 00000000000..6888baa877d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/switchLowering.out @@ -0,0 +1,6 @@ +EnumA.A +ok +ok +ok +ok +ok diff --git a/kotlin-native/backend.native/tests/codegen/enum/test0.out b/kotlin-native/backend.native/tests/codegen/enum/test0.out new file mode 100644 index 00000000000..2dfe6a37a0f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/test0.out @@ -0,0 +1 @@ +VALUE diff --git a/kotlin-native/backend.native/tests/codegen/enum/test1.out b/kotlin-native/backend.native/tests/codegen/enum/test1.out new file mode 100644 index 00000000000..2269bb980a6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/test1.out @@ -0,0 +1 @@ +z12 diff --git a/kotlin-native/backend.native/tests/codegen/enum/vCallNoEntryClass.out b/kotlin-native/backend.native/tests/codegen/enum/vCallNoEntryClass.out new file mode 100644 index 00000000000..1e2b9f77427 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/vCallNoEntryClass.out @@ -0,0 +1 @@ +('z3', 3) diff --git a/kotlin-native/backend.native/tests/codegen/enum/vCallWithEntryClass.out b/kotlin-native/backend.native/tests/codegen/enum/vCallWithEntryClass.out new file mode 100644 index 00000000000..254c7c0c883 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/vCallWithEntryClass.out @@ -0,0 +1 @@ +z1z2 diff --git a/kotlin-native/backend.native/tests/codegen/enum/valueOf.out b/kotlin-native/backend.native/tests/codegen/enum/valueOf.out new file mode 100644 index 00000000000..d768aee29a7 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/valueOf.out @@ -0,0 +1,6 @@ +E1 +E2 +E3 +E1 +E2 +E3 diff --git a/kotlin-native/backend.native/tests/codegen/enum/values.out b/kotlin-native/backend.native/tests/codegen/enum/values.out new file mode 100644 index 00000000000..3faa62b18e2 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/values.out @@ -0,0 +1,6 @@ +E3 +E1 +E2 +E3 +E1 +E2 diff --git a/kotlin-native/backend.native/tests/codegen/enum/varargParam.out b/kotlin-native/backend.native/tests/codegen/enum/varargParam.out new file mode 100644 index 00000000000..00750edc07d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/enum/varargParam.out @@ -0,0 +1 @@ +3 diff --git a/kotlin-native/backend.native/tests/codegen/function/defaults10.out b/kotlin-native/backend.native/tests/codegen/function/defaults10.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaults10.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/function/defaults4.out b/kotlin-native/backend.native/tests/codegen/function/defaults4.out new file mode 100644 index 00000000000..920a1396648 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaults4.out @@ -0,0 +1 @@ +43 diff --git a/kotlin-native/backend.native/tests/codegen/function/defaults5.out b/kotlin-native/backend.native/tests/codegen/function/defaults5.out new file mode 100644 index 00000000000..6613b568867 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaults5.out @@ -0,0 +1,2 @@ +5 +6 diff --git a/kotlin-native/backend.native/tests/codegen/function/defaults6.out b/kotlin-native/backend.native/tests/codegen/function/defaults6.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaults6.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/function/defaults7.out b/kotlin-native/backend.native/tests/codegen/function/defaults7.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaults7.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/function/defaults8.out b/kotlin-native/backend.native/tests/codegen/function/defaults8.out new file mode 100644 index 00000000000..0cfbf08886f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaults8.out @@ -0,0 +1 @@ +2 diff --git a/kotlin-native/backend.native/tests/codegen/function/defaults9.out b/kotlin-native/backend.native/tests/codegen/function/defaults9.out new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaults9.out @@ -0,0 +1 @@ +1 diff --git a/kotlin-native/backend.native/tests/codegen/function/defaultsFromFakeOverride.out b/kotlin-native/backend.native/tests/codegen/function/defaultsFromFakeOverride.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaultsFromFakeOverride.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/function/defaultsWithVarArg1.out b/kotlin-native/backend.native/tests/codegen/function/defaultsWithVarArg1.out new file mode 100644 index 00000000000..bb168e691f7 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaultsWithVarArg1.out @@ -0,0 +1,3 @@ +Hello , Correct! +Hello World, Correct! + , Correct! diff --git a/kotlin-native/backend.native/tests/codegen/function/defaultsWithVarArg2.out b/kotlin-native/backend.native/tests/codegen/function/defaultsWithVarArg2.out new file mode 100644 index 00000000000..730baf6de6d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/defaultsWithVarArg2.out @@ -0,0 +1,3 @@ +1 +2 +42 diff --git a/kotlin-native/backend.native/tests/codegen/function/localFunction.out b/kotlin-native/backend.native/tests/codegen/function/localFunction.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/localFunction.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/function/localFunction2.out b/kotlin-native/backend.native/tests/codegen/function/localFunction2.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/localFunction2.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/function/localFunction3.out b/kotlin-native/backend.native/tests/codegen/function/localFunction3.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/localFunction3.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/function/referenceBigArity.out b/kotlin-native/backend.native/tests/codegen/function/referenceBigArity.out new file mode 100644 index 00000000000..9dbddfafab5 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/referenceBigArity.out @@ -0,0 +1 @@ +528 diff --git a/kotlin-native/backend.native/tests/codegen/function/unreachableStatementAfterReturn.out b/kotlin-native/backend.native/tests/codegen/function/unreachableStatementAfterReturn.out new file mode 100644 index 00000000000..94ebaf90016 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/function/unreachableStatementAfterReturn.out @@ -0,0 +1,4 @@ +1 +2 +3 +4 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/correctOrder1.out b/kotlin-native/backend.native/tests/codegen/initializers/correctOrder1.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/correctOrder1.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/correctOrder2.out b/kotlin-native/backend.native/tests/codegen/initializers/correctOrder2.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/correctOrder2.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/correctOrder3.out b/kotlin-native/backend.native/tests/codegen/initializers/correctOrder3.out new file mode 100644 index 00000000000..00750edc07d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/correctOrder3.out @@ -0,0 +1 @@ +3 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer1.out b/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer1.out new file mode 100644 index 00000000000..cad99e12229 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer1.out @@ -0,0 +1 @@ +caught diff --git a/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer2.out b/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer2.out new file mode 100644 index 00000000000..4fbc465ea00 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer2.out @@ -0,0 +1,2 @@ +caught +caught2 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer3.out b/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer3.out new file mode 100644 index 00000000000..4fbc465ea00 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer3.out @@ -0,0 +1,2 @@ +caught +caught2 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer4.out b/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer4.out new file mode 100644 index 00000000000..4fbc465ea00 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/failInInitializer4.out @@ -0,0 +1,2 @@ +caught +caught2 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/linkTest1_main.out b/kotlin-native/backend.native/tests/codegen/initializers/linkTest1_main.out new file mode 100644 index 00000000000..59a3ec59b53 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/linkTest1_main.out @@ -0,0 +1 @@ +1200 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/linkTest2_main.out b/kotlin-native/backend.native/tests/codegen/initializers/linkTest2_main.out new file mode 100644 index 00000000000..0cfbf08886f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/linkTest2_main.out @@ -0,0 +1 @@ +2 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/return1.out b/kotlin-native/backend.native/tests/codegen/initializers/return1.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/return1.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/return2.out b/kotlin-native/backend.native/tests/codegen/initializers/return2.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/return2.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/throw1.out b/kotlin-native/backend.native/tests/codegen/initializers/throw1.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/throw1.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/throw2.out b/kotlin-native/backend.native/tests/codegen/initializers/throw2.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/throw2.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/when1.out b/kotlin-native/backend.native/tests/codegen/initializers/when1.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/when1.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/when2.out b/kotlin-native/backend.native/tests/codegen/initializers/when2.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/when2.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/while1.out b/kotlin-native/backend.native/tests/codegen/initializers/while1.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/while1.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/while2.out b/kotlin-native/backend.native/tests/codegen/initializers/while2.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/while2.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/while3.out b/kotlin-native/backend.native/tests/codegen/initializers/while3.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/while3.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/workers1.out b/kotlin-native/backend.native/tests/codegen/initializers/workers1.out new file mode 100644 index 00000000000..72350c3f031 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/workers1.out @@ -0,0 +1,2 @@ +42 +3 diff --git a/kotlin-native/backend.native/tests/codegen/initializers/workers2.out b/kotlin-native/backend.native/tests/codegen/initializers/workers2.out new file mode 100644 index 00000000000..daaac9e3030 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/initializers/workers2.out @@ -0,0 +1,2 @@ +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/inline/changingCapturedLocal.out b/kotlin-native/backend.native/tests/codegen/inline/changingCapturedLocal.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/changingCapturedLocal.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/inline/classDeclarationInsideInline.out b/kotlin-native/backend.native/tests/codegen/inline/classDeclarationInsideInline.out new file mode 100644 index 00000000000..e3f9ff3d26c --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/classDeclarationInsideInline.out @@ -0,0 +1,3 @@ +test1: 1.0 +1 +test2 diff --git a/kotlin-native/backend.native/tests/codegen/inline/coercionToUnit.out b/kotlin-native/backend.native/tests/codegen/inline/coercionToUnit.out new file mode 100644 index 00000000000..0fd40fc5055 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/coercionToUnit.out @@ -0,0 +1 @@ +kotlin.Unit diff --git a/kotlin-native/backend.native/tests/codegen/inline/correctOrderFunctionReference.out b/kotlin-native/backend.native/tests/codegen/inline/correctOrderFunctionReference.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/correctOrderFunctionReference.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/inline/defaultArgs.out b/kotlin-native/backend.native/tests/codegen/inline/defaultArgs.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/defaultArgs.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/inline/defaultArgs_linkTest_main.out b/kotlin-native/backend.native/tests/codegen/inline/defaultArgs_linkTest_main.out new file mode 100644 index 00000000000..7cd6da5fb23 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/defaultArgs_linkTest_main.out @@ -0,0 +1,2 @@ +122 +47 diff --git a/kotlin-native/backend.native/tests/codegen/inline/genericFunctionReference.out b/kotlin-native/backend.native/tests/codegen/inline/genericFunctionReference.out new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/genericFunctionReference.out @@ -0,0 +1 @@ +0 diff --git a/kotlin-native/backend.native/tests/codegen/inline/getClass.out b/kotlin-native/backend.native/tests/codegen/inline/getClass.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/getClass.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline0.out b/kotlin-native/backend.native/tests/codegen/inline/inline0.out new file mode 100644 index 00000000000..871727de1fd --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline0.out @@ -0,0 +1 @@ +84 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline1.out b/kotlin-native/backend.native/tests/codegen/inline/inline1.out new file mode 100644 index 00000000000..802992c4220 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline1.out @@ -0,0 +1 @@ +Hello world diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline10.out b/kotlin-native/backend.native/tests/codegen/inline/inline10.out new file mode 100644 index 00000000000..0cfbf08886f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline10.out @@ -0,0 +1 @@ +2 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline13.out b/kotlin-native/backend.native/tests/codegen/inline/inline13.out new file mode 100644 index 00000000000..27ba77ddaf6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline13.out @@ -0,0 +1 @@ +true diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline14.out b/kotlin-native/backend.native/tests/codegen/inline/inline14.out new file mode 100644 index 00000000000..ec635144f60 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline14.out @@ -0,0 +1 @@ +9 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline15.out b/kotlin-native/backend.native/tests/codegen/inline/inline15.out new file mode 100644 index 00000000000..b8626c4cff2 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline15.out @@ -0,0 +1 @@ +4 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline16.out b/kotlin-native/backend.native/tests/codegen/inline/inline16.out new file mode 100644 index 00000000000..c508d5366f7 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline16.out @@ -0,0 +1 @@ +false diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline17.out b/kotlin-native/backend.native/tests/codegen/inline/inline17.out new file mode 100644 index 00000000000..44e2ace7e54 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline17.out @@ -0,0 +1 @@ +[1, 2] diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline18.out b/kotlin-native/backend.native/tests/codegen/inline/inline18.out new file mode 100644 index 00000000000..27ba77ddaf6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline18.out @@ -0,0 +1 @@ +true diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline19.out b/kotlin-native/backend.native/tests/codegen/inline/inline19.out new file mode 100644 index 00000000000..1e8b3149621 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline19.out @@ -0,0 +1 @@ +6 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline2.out b/kotlin-native/backend.native/tests/codegen/inline/inline2.out new file mode 100644 index 00000000000..49080c6fcad --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline2.out @@ -0,0 +1 @@ +hello 1 8 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline20.out b/kotlin-native/backend.native/tests/codegen/inline/inline20.out new file mode 100644 index 00000000000..24c5735c3e8 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline20.out @@ -0,0 +1 @@ +def diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline21.out b/kotlin-native/backend.native/tests/codegen/inline/inline21.out new file mode 100644 index 00000000000..a4c2f6a3f74 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline21.out @@ -0,0 +1,4 @@ +bar +foo1 +foo2 +33 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline22.out b/kotlin-native/backend.native/tests/codegen/inline/inline22.out new file mode 100644 index 00000000000..8351c19397f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline22.out @@ -0,0 +1 @@ +14 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline23.out b/kotlin-native/backend.native/tests/codegen/inline/inline23.out new file mode 100644 index 00000000000..bb95160cb6e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline23.out @@ -0,0 +1 @@ +33 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline24.out b/kotlin-native/backend.native/tests/codegen/inline/inline24.out new file mode 100644 index 00000000000..128976523b6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline24.out @@ -0,0 +1,2 @@ +bar +foo diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline25.out b/kotlin-native/backend.native/tests/codegen/inline/inline25.out new file mode 100644 index 00000000000..541dab48def --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline25.out @@ -0,0 +1,2 @@ +Ok +Ok diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline26.out b/kotlin-native/backend.native/tests/codegen/inline/inline26.out new file mode 100644 index 00000000000..7ed6ff82de6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline26.out @@ -0,0 +1 @@ +5 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline3.out b/kotlin-native/backend.native/tests/codegen/inline/inline3.out new file mode 100644 index 00000000000..7ed6ff82de6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline3.out @@ -0,0 +1 @@ +5 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline4.out b/kotlin-native/backend.native/tests/codegen/inline/inline4.out new file mode 100644 index 00000000000..00750edc07d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline4.out @@ -0,0 +1 @@ +3 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline5.out b/kotlin-native/backend.native/tests/codegen/inline/inline5.out new file mode 100644 index 00000000000..bb95160cb6e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline5.out @@ -0,0 +1 @@ +33 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline6.out b/kotlin-native/backend.native/tests/codegen/inline/inline6.out new file mode 100644 index 00000000000..b2af0be1b69 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline6.out @@ -0,0 +1,4 @@ +hello1 +hello2 +hello3 +hello4 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline7.out b/kotlin-native/backend.native/tests/codegen/inline/inline7.out new file mode 100644 index 00000000000..01e79c32a8c --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline7.out @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline8.out b/kotlin-native/backend.native/tests/codegen/inline/inline8.out new file mode 100644 index 00000000000..45a4fb75db8 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline8.out @@ -0,0 +1 @@ +8 diff --git a/kotlin-native/backend.native/tests/codegen/inline/inline9.out b/kotlin-native/backend.native/tests/codegen/inline/inline9.out new file mode 100644 index 00000000000..67d1adb3ff3 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/inline9.out @@ -0,0 +1,2 @@ +hello +6 diff --git a/kotlin-native/backend.native/tests/codegen/inline/lambdaAsAny.out b/kotlin-native/backend.native/tests/codegen/inline/lambdaAsAny.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/lambdaAsAny.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/inline/lambdaInDefaultValue.out b/kotlin-native/backend.native/tests/codegen/inline/lambdaInDefaultValue.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/lambdaInDefaultValue.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/inline/lateinitProperty_linkTest_main.out b/kotlin-native/backend.native/tests/codegen/inline/lateinitProperty_linkTest_main.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/lateinitProperty_linkTest_main.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/inline/localFunctionInInitializerBlock.out b/kotlin-native/backend.native/tests/codegen/inline/localFunctionInInitializerBlock.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/localFunctionInInitializerBlock.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/inline/localObjectReturnedFromWhen.out b/kotlin-native/backend.native/tests/codegen/inline/localObjectReturnedFromWhen.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/localObjectReturnedFromWhen.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/inline/propertyAccessorInline.out b/kotlin-native/backend.native/tests/codegen/inline/propertyAccessorInline.out new file mode 100644 index 00000000000..7ee4383e424 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/propertyAccessorInline.out @@ -0,0 +1,2 @@ +123 +42 diff --git a/kotlin-native/backend.native/tests/codegen/inline/returnLocalClassFromBlock.out b/kotlin-native/backend.native/tests/codegen/inline/returnLocalClassFromBlock.out new file mode 100644 index 00000000000..a7bfde6f0ec --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/returnLocalClassFromBlock.out @@ -0,0 +1 @@ +Zzz diff --git a/kotlin-native/backend.native/tests/codegen/inline/sharedVar_linkTest_main.out b/kotlin-native/backend.native/tests/codegen/inline/sharedVar_linkTest_main.out new file mode 100644 index 00000000000..1e8b3149621 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/sharedVar_linkTest_main.out @@ -0,0 +1 @@ +6 diff --git a/kotlin-native/backend.native/tests/codegen/inline/statementAsLastExprInBlock.out b/kotlin-native/backend.native/tests/codegen/inline/statementAsLastExprInBlock.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/statementAsLastExprInBlock.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/inline/twiceInlinedObject.out b/kotlin-native/backend.native/tests/codegen/inline/twiceInlinedObject.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/twiceInlinedObject.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/codegen/inline/typeSubstitutionInFakeOverride.out b/kotlin-native/backend.native/tests/codegen/inline/typeSubstitutionInFakeOverride.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/inline/typeSubstitutionInFakeOverride.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/innerClass/doubleInner.out b/kotlin-native/backend.native/tests/codegen/innerClass/doubleInner.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/innerClass/doubleInner.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/innerClass/generic.out b/kotlin-native/backend.native/tests/codegen/innerClass/generic.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/innerClass/generic.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/innerClass/getOuterVal.out b/kotlin-native/backend.native/tests/codegen/innerClass/getOuterVal.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/innerClass/getOuterVal.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/innerClass/noPrimaryConstructor.out b/kotlin-native/backend.native/tests/codegen/innerClass/noPrimaryConstructor.out new file mode 100644 index 00000000000..2c94e483710 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/innerClass/noPrimaryConstructor.out @@ -0,0 +1,2 @@ +OK +OK diff --git a/kotlin-native/backend.native/tests/codegen/innerClass/qualifiedThis.out b/kotlin-native/backend.native/tests/codegen/innerClass/qualifiedThis.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/innerClass/qualifiedThis.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/innerClass/secondaryConstructor.out b/kotlin-native/backend.native/tests/codegen/innerClass/secondaryConstructor.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/innerClass/secondaryConstructor.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/innerClass/simple.out b/kotlin-native/backend.native/tests/codegen/innerClass/simple.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/innerClass/simple.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/innerClass/superOuter.out b/kotlin-native/backend.native/tests/codegen/innerClass/superOuter.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/innerClass/superOuter.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/interfaceCallsNCasts/conservativeItable.out b/kotlin-native/backend.native/tests/codegen/interfaceCallsNCasts/conservativeItable.out new file mode 100644 index 00000000000..179af5fc996 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/interfaceCallsNCasts/conservativeItable.out @@ -0,0 +1,3 @@ +539 +5050 +26551140 diff --git a/kotlin-native/backend.native/tests/codegen/kclass/kClassEnumArgument.out b/kotlin-native/backend.native/tests/codegen/kclass/kClassEnumArgument.out new file mode 100644 index 00000000000..102e3209c64 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/kclass/kClassEnumArgument.out @@ -0,0 +1 @@ +String diff --git a/kotlin-native/backend.native/tests/codegen/kclass/kclass1.out b/kotlin-native/backend.native/tests/codegen/kclass/kclass1.out new file mode 100644 index 00000000000..09d20e8d4ca --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/kclass/kclass1.out @@ -0,0 +1 @@ +OK :D diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda1.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda1.out new file mode 100644 index 00000000000..13f74ac1d90 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda1.out @@ -0,0 +1 @@ +lambda diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda10.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda10.out new file mode 100644 index 00000000000..27530da547f --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda10.out @@ -0,0 +1,2 @@ +original +changed diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda11.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda11.out new file mode 100644 index 00000000000..66a52ee7a1d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda11.out @@ -0,0 +1,2 @@ +first +second diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda12.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda12.out new file mode 100644 index 00000000000..814f4a42292 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda12.out @@ -0,0 +1,2 @@ +one +two diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda13.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda13.out new file mode 100644 index 00000000000..257cc5642cb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda13.out @@ -0,0 +1 @@ +foo diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda2.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda2.out new file mode 100644 index 00000000000..3432ce3d58d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda2.out @@ -0,0 +1 @@ +arg0 diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda3.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda3.out new file mode 100644 index 00000000000..13f74ac1d90 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda3.out @@ -0,0 +1 @@ +lambda diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda4.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda4.out new file mode 100644 index 00000000000..de670dc1c44 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda4.out @@ -0,0 +1,5 @@ +1 +2 +3 +3 +4 diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda5.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda5.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda5.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda6.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda6.out new file mode 100644 index 00000000000..0df2ee0c6b0 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda6.out @@ -0,0 +1,2 @@ +42 +captured diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda7.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda7.out new file mode 100644 index 00000000000..920a1396648 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda7.out @@ -0,0 +1 @@ +43 diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda8.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda8.out new file mode 100644 index 00000000000..8058d48ad21 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda8.out @@ -0,0 +1,8 @@ +first +0 +second +0 +first +1 +second +1 diff --git a/kotlin-native/backend.native/tests/codegen/lambda/lambda9.out b/kotlin-native/backend.native/tests/codegen/lambda/lambda9.out new file mode 100644 index 00000000000..c476ef19641 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lambda/lambda9.out @@ -0,0 +1,8 @@ +0 +0 +1 +0 +0 +1 +1 +1 diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/globalIsInitialized.out b/kotlin-native/backend.native/tests/codegen/lateinit/globalIsInitialized.out new file mode 100644 index 00000000000..1d474d52557 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/globalIsInitialized.out @@ -0,0 +1,2 @@ +false +true diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/inBaseClass.out b/kotlin-native/backend.native/tests/codegen/lateinit/inBaseClass.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/inBaseClass.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/initialized.out b/kotlin-native/backend.native/tests/codegen/lateinit/initialized.out new file mode 100644 index 00000000000..b1a17ba1369 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/initialized.out @@ -0,0 +1 @@ +zzz diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/innerIsInitialized.out b/kotlin-native/backend.native/tests/codegen/lateinit/innerIsInitialized.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/innerIsInitialized.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/isInitialized.out b/kotlin-native/backend.native/tests/codegen/lateinit/isInitialized.out new file mode 100644 index 00000000000..1d474d52557 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/isInitialized.out @@ -0,0 +1,2 @@ +false +true diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/localCapturedInitialized.out b/kotlin-native/backend.native/tests/codegen/lateinit/localCapturedInitialized.out new file mode 100644 index 00000000000..b1a17ba1369 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/localCapturedInitialized.out @@ -0,0 +1 @@ +zzz diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/localCapturedNotInitialized.out b/kotlin-native/backend.native/tests/codegen/lateinit/localCapturedNotInitialized.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/localCapturedNotInitialized.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/localInitialized.out b/kotlin-native/backend.native/tests/codegen/lateinit/localInitialized.out new file mode 100644 index 00000000000..b1a17ba1369 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/localInitialized.out @@ -0,0 +1 @@ +zzz diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/localNotInitialized.out b/kotlin-native/backend.native/tests/codegen/lateinit/localNotInitialized.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/localNotInitialized.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/lateinit/notInitialized.out b/kotlin-native/backend.native/tests/codegen/lateinit/notInitialized.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/lateinit/notInitialized.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/localClass/innerTakesCapturedFromOuter.out b/kotlin-native/backend.native/tests/codegen/localClass/innerTakesCapturedFromOuter.out new file mode 100644 index 00000000000..0d66ea1aee9 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localClass/innerTakesCapturedFromOuter.out @@ -0,0 +1,2 @@ +0 +1 diff --git a/kotlin-native/backend.native/tests/codegen/localClass/innerWithCapture.out b/kotlin-native/backend.native/tests/codegen/localClass/innerWithCapture.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localClass/innerWithCapture.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/localClass/localFunctionCallFromLocalClass.out b/kotlin-native/backend.native/tests/codegen/localClass/localFunctionCallFromLocalClass.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localClass/localFunctionCallFromLocalClass.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/localClass/localFunctionInLocalClass.out b/kotlin-native/backend.native/tests/codegen/localClass/localFunctionInLocalClass.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localClass/localFunctionInLocalClass.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/localClass/localHierarchy.out b/kotlin-native/backend.native/tests/codegen/localClass/localHierarchy.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localClass/localHierarchy.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/localClass/noPrimaryConstructor.out b/kotlin-native/backend.native/tests/codegen/localClass/noPrimaryConstructor.out new file mode 100644 index 00000000000..d65874ef665 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localClass/noPrimaryConstructor.out @@ -0,0 +1 @@ +OKOK diff --git a/kotlin-native/backend.native/tests/codegen/localClass/objectExpressionInInitializer.out b/kotlin-native/backend.native/tests/codegen/localClass/objectExpressionInInitializer.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localClass/objectExpressionInInitializer.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/localClass/objectExpressionInProperty.out b/kotlin-native/backend.native/tests/codegen/localClass/objectExpressionInProperty.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localClass/objectExpressionInProperty.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/localClass/tryCatch.out b/kotlin-native/backend.native/tests/codegen/localClass/tryCatch.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/codegen/localClass/virtualCallFromConstructor.out b/kotlin-native/backend.native/tests/codegen/localClass/virtualCallFromConstructor.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localClass/virtualCallFromConstructor.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/codegen/localEscapeAnalysis/arraysFieldWrite.out b/kotlin-native/backend.native/tests/codegen/localEscapeAnalysis/arraysFieldWrite.out new file mode 100644 index 00000000000..e5febaf76d2 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/localEscapeAnalysis/arraysFieldWrite.out @@ -0,0 +1,18 @@ +Array (constructor init): +Size: 2 +Contents: [1, 2] +Array (constructor init): +Size: 2 +Contents: [3, 4] +Array (default value init): +Size: 2 +Contents: [1, 2] +Array (default value init): +Size: 2 +Contents: [3, 4] +Array (init block): +Size: 2 +Contents: [1, 2] +Array (init block): +Size: 2 +Contents: [3, 4] diff --git a/kotlin-native/backend.native/tests/codegen/mpp/mpp2.out b/kotlin-native/backend.native/tests/codegen/mpp/mpp2.out new file mode 100644 index 00000000000..7c6d1a38c2b --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/mpp/mpp2.out @@ -0,0 +1,4 @@ +C(arg=42) +true +1 +h diff --git a/kotlin-native/backend.native/tests/codegen/mpp/remap_expect_property_ref_main.out b/kotlin-native/backend.native/tests/codegen/mpp/remap_expect_property_ref_main.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/mpp/remap_expect_property_ref_main.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/object/fields2.out b/kotlin-native/backend.native/tests/codegen/object/fields2.out new file mode 100644 index 00000000000..25818a613a7 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/object/fields2.out @@ -0,0 +1,6 @@ +Set global = 1 +Set member = 42 +Get member = 42 +Set global = 42 +Get global = 42 +Set member = 42 diff --git a/kotlin-native/backend.native/tests/codegen/object/initialization1.out b/kotlin-native/backend.native/tests/codegen/object/initialization1.out new file mode 100644 index 00000000000..97bc2304c6a --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/object/initialization1.out @@ -0,0 +1,7 @@ +init +field +constructor1 +init +field +constructor1 +constructor2 diff --git a/kotlin-native/backend.native/tests/codegen/objectExpression/expr1.out b/kotlin-native/backend.native/tests/codegen/objectExpression/expr1.out new file mode 100644 index 00000000000..bf59612bf5a --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/objectExpression/expr1.out @@ -0,0 +1 @@ +aabb diff --git a/kotlin-native/backend.native/tests/codegen/objectExpression/expr2.out b/kotlin-native/backend.native/tests/codegen/objectExpression/expr2.out new file mode 100644 index 00000000000..78981922613 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/objectExpression/expr2.out @@ -0,0 +1 @@ +a diff --git a/kotlin-native/backend.native/tests/codegen/objectExpression/expr3.out b/kotlin-native/backend.native/tests/codegen/objectExpression/expr3.out new file mode 100644 index 00000000000..2867aeb3fa1 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/objectExpression/expr3.out @@ -0,0 +1,3 @@ + +1 +2 diff --git a/kotlin-native/backend.native/tests/codegen/propertyCallableReference/dynamicReceiver.out b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/dynamicReceiver.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/dynamicReceiver.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/propertyCallableReference/linkTest_main.out b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/linkTest_main.out new file mode 100644 index 00000000000..6f7eb39b03d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/linkTest_main.out @@ -0,0 +1,2 @@ +42 +117 diff --git a/kotlin-native/backend.native/tests/codegen/propertyCallableReference/valClass.out b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/valClass.out new file mode 100644 index 00000000000..6f7eb39b03d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/valClass.out @@ -0,0 +1,2 @@ +42 +117 diff --git a/kotlin-native/backend.native/tests/codegen/propertyCallableReference/valExtension.out b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/valExtension.out new file mode 100644 index 00000000000..6f7eb39b03d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/valExtension.out @@ -0,0 +1,2 @@ +42 +117 diff --git a/kotlin-native/backend.native/tests/codegen/propertyCallableReference/valModule.out b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/valModule.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/valModule.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/codegen/propertyCallableReference/varClass.out b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/varClass.out new file mode 100644 index 00000000000..9b02e021d66 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/varClass.out @@ -0,0 +1,4 @@ +117 +117 +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/propertyCallableReference/varExtension.out b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/varExtension.out new file mode 100644 index 00000000000..9b02e021d66 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/varExtension.out @@ -0,0 +1,4 @@ +117 +117 +42 +42 diff --git a/kotlin-native/backend.native/tests/codegen/propertyCallableReference/varModule.out b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/varModule.out new file mode 100644 index 00000000000..efe626e6ae7 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/propertyCallableReference/varModule.out @@ -0,0 +1,2 @@ +117 +117 diff --git a/kotlin-native/backend.native/tests/codegen/try/catch3.out b/kotlin-native/backend.native/tests/codegen/try/catch3.out new file mode 100644 index 00000000000..6bd4ef2c642 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/catch3.out @@ -0,0 +1,3 @@ +Before +Caught Throwable +Done diff --git a/kotlin-native/backend.native/tests/codegen/try/catch4.out b/kotlin-native/backend.native/tests/codegen/try/catch4.out new file mode 100644 index 00000000000..5b328e91afc --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/catch4.out @@ -0,0 +1,3 @@ +Before +Caught Error +Done diff --git a/kotlin-native/backend.native/tests/codegen/try/catch5.out b/kotlin-native/backend.native/tests/codegen/try/catch5.out new file mode 100644 index 00000000000..5b328e91afc --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/catch5.out @@ -0,0 +1,3 @@ +Before +Caught Error +Done diff --git a/kotlin-native/backend.native/tests/codegen/try/catch6.out b/kotlin-native/backend.native/tests/codegen/try/catch6.out new file mode 100644 index 00000000000..5b328e91afc --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/catch6.out @@ -0,0 +1,3 @@ +Before +Caught Error +Done diff --git a/kotlin-native/backend.native/tests/codegen/try/catch8.out b/kotlin-native/backend.native/tests/codegen/try/catch8.out new file mode 100644 index 00000000000..a267b9d963b --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/catch8.out @@ -0,0 +1 @@ +Error happens diff --git a/kotlin-native/backend.native/tests/codegen/try/finally1.out b/kotlin-native/backend.native/tests/codegen/try/finally1.out new file mode 100644 index 00000000000..f4543f55b6e --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally1.out @@ -0,0 +1,3 @@ +Try +Finally +Done diff --git a/kotlin-native/backend.native/tests/codegen/try/finally10.out b/kotlin-native/backend.native/tests/codegen/try/finally10.out new file mode 100644 index 00000000000..63caa041ba4 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally10.out @@ -0,0 +1,2 @@ +Finally +After diff --git a/kotlin-native/backend.native/tests/codegen/try/finally11.out b/kotlin-native/backend.native/tests/codegen/try/finally11.out new file mode 100644 index 00000000000..ce12827782a --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally11.out @@ -0,0 +1,3 @@ +Finally +Catch 2 +Done diff --git a/kotlin-native/backend.native/tests/codegen/try/finally2.out b/kotlin-native/backend.native/tests/codegen/try/finally2.out new file mode 100644 index 00000000000..ad1ed092296 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally2.out @@ -0,0 +1,4 @@ +Try +Caught Error +Finally +Done diff --git a/kotlin-native/backend.native/tests/codegen/try/finally3.out b/kotlin-native/backend.native/tests/codegen/try/finally3.out new file mode 100644 index 00000000000..7a5ea9e31b2 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally3.out @@ -0,0 +1,4 @@ +Try +Finally +Caught Error +Done diff --git a/kotlin-native/backend.native/tests/codegen/try/finally4.out b/kotlin-native/backend.native/tests/codegen/try/finally4.out new file mode 100644 index 00000000000..bc0c64ef690 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally4.out @@ -0,0 +1,5 @@ +Try +Catch +Finally +Caught Exception +Done diff --git a/kotlin-native/backend.native/tests/codegen/try/finally5.out b/kotlin-native/backend.native/tests/codegen/try/finally5.out new file mode 100644 index 00000000000..0b2daf4d255 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally5.out @@ -0,0 +1,3 @@ +Done +Finally +0 diff --git a/kotlin-native/backend.native/tests/codegen/try/finally6.out b/kotlin-native/backend.native/tests/codegen/try/finally6.out new file mode 100644 index 00000000000..47059408287 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally6.out @@ -0,0 +1,3 @@ +Done +Finally +1 diff --git a/kotlin-native/backend.native/tests/codegen/try/finally7.out b/kotlin-native/backend.native/tests/codegen/try/finally7.out new file mode 100644 index 00000000000..47059408287 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally7.out @@ -0,0 +1,3 @@ +Done +Finally +1 diff --git a/kotlin-native/backend.native/tests/codegen/try/finally8.out b/kotlin-native/backend.native/tests/codegen/try/finally8.out new file mode 100644 index 00000000000..3689d4c0f5a --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally8.out @@ -0,0 +1,3 @@ +Finally 1 +Finally 2 +42 diff --git a/kotlin-native/backend.native/tests/codegen/try/finally9.out b/kotlin-native/backend.native/tests/codegen/try/finally9.out new file mode 100644 index 00000000000..9952236e75d --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/finally9.out @@ -0,0 +1,3 @@ +Finally 1 +Finally 2 +After diff --git a/kotlin-native/backend.native/tests/codegen/try/returnsDifferentTypes.out b/kotlin-native/backend.native/tests/codegen/try/returnsDifferentTypes.out new file mode 100644 index 00000000000..cd802af9bb3 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/returnsDifferentTypes.out @@ -0,0 +1,2 @@ +zzz +42 diff --git a/kotlin-native/backend.native/tests/codegen/try/try1.out b/kotlin-native/backend.native/tests/codegen/try/try1.out new file mode 100644 index 00000000000..7ed6ff82de6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/try1.out @@ -0,0 +1 @@ +5 diff --git a/kotlin-native/backend.native/tests/codegen/try/try2.out b/kotlin-native/backend.native/tests/codegen/try/try2.out new file mode 100644 index 00000000000..1e8b3149621 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/try2.out @@ -0,0 +1 @@ +6 diff --git a/kotlin-native/backend.native/tests/codegen/try/try3.out b/kotlin-native/backend.native/tests/codegen/try/try3.out new file mode 100644 index 00000000000..1e8b3149621 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/try3.out @@ -0,0 +1 @@ +6 diff --git a/kotlin-native/backend.native/tests/codegen/try/try4.out b/kotlin-native/backend.native/tests/codegen/try/try4.out new file mode 100644 index 00000000000..454a56d1704 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/try/try4.out @@ -0,0 +1,2 @@ +Try +5 diff --git a/kotlin-native/backend.native/tests/datagen/literals/empty_string.out b/kotlin-native/backend.native/tests/datagen/literals/empty_string.out new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/kotlin-native/backend.native/tests/datagen/literals/empty_string.out @@ -0,0 +1 @@ + diff --git a/kotlin-native/backend.native/tests/datagen/literals/listof1.out b/kotlin-native/backend.native/tests/datagen/literals/listof1.out new file mode 100644 index 00000000000..c15eb0c2a16 --- /dev/null +++ b/kotlin-native/backend.native/tests/datagen/literals/listof1.out @@ -0,0 +1,2 @@ +true +[a, b, c] diff --git a/kotlin-native/backend.native/tests/datagen/literals/strdedup1.out b/kotlin-native/backend.native/tests/datagen/literals/strdedup1.out new file mode 100644 index 00000000000..bb101b641b9 --- /dev/null +++ b/kotlin-native/backend.native/tests/datagen/literals/strdedup1.out @@ -0,0 +1,2 @@ +true +true diff --git a/kotlin-native/backend.native/tests/datagen/literals/strdedup2.out b/kotlin-native/backend.native/tests/datagen/literals/strdedup2.out new file mode 100644 index 00000000000..bb101b641b9 --- /dev/null +++ b/kotlin-native/backend.native/tests/datagen/literals/strdedup2.out @@ -0,0 +1,2 @@ +true +true diff --git a/kotlin-native/backend.native/tests/datagen/rtti/vtable_any.out b/kotlin-native/backend.native/tests/datagen/rtti/vtable_any.out new file mode 100644 index 00000000000..bef75e4c66c --- /dev/null +++ b/kotlin-native/backend.native/tests/datagen/rtti/vtable_any.out @@ -0,0 +1,4 @@ +[1] +[2] +[3] +[4] diff --git a/kotlin-native/backend.native/tests/interop/basics/0.out b/kotlin-native/backend.native/tests/interop/basics/0.out new file mode 100644 index 00000000000..aa47d0d46d4 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/basics/0.out @@ -0,0 +1,2 @@ +0 +0 diff --git a/kotlin-native/backend.native/tests/interop/basics/1.out b/kotlin-native/backend.native/tests/interop/basics/1.out new file mode 100644 index 00000000000..00b1ec5889f --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/basics/1.out @@ -0,0 +1,3 @@ +257 +-1 +-2 diff --git a/kotlin-native/backend.native/tests/interop/basics/2.out b/kotlin-native/backend.native/tests/interop/basics/2.out new file mode 100644 index 00000000000..e965047ad7c --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/basics/2.out @@ -0,0 +1 @@ +Hello diff --git a/kotlin-native/backend.native/tests/interop/basics/3.out b/kotlin-native/backend.native/tests/interop/basics/3.out new file mode 100644 index 00000000000..9110b8474f8 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/basics/3.out @@ -0,0 +1 @@ +8 9 12 13 14 diff --git a/kotlin-native/backend.native/tests/interop/basics/4.out b/kotlin-native/backend.native/tests/interop/basics/4.out new file mode 100644 index 00000000000..d5be26de679 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/basics/4.out @@ -0,0 +1,2 @@ +a b -1 2 3 9223372036854775807 0.1 0.2 1 0 +1 42 diff --git a/kotlin-native/backend.native/tests/interop/basics/5.out b/kotlin-native/backend.native/tests/interop/basics/5.out new file mode 100644 index 00000000000..10ddd6d257e --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/basics/5.out @@ -0,0 +1 @@ +Hello! diff --git a/kotlin-native/backend.native/tests/interop/basics/funptr.out b/kotlin-native/backend.native/tests/interop/basics/funptr.out new file mode 100644 index 00000000000..8aa6fb44240 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/basics/funptr.out @@ -0,0 +1,6 @@ +42 +17 +1 +0 +42 +42 diff --git a/kotlin-native/backend.native/tests/interop/cleaners/cleaners-leak.out b/kotlin-native/backend.native/tests/interop/cleaners/cleaners-leak.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/interop/cleaners/cleaners-main_thread.out b/kotlin-native/backend.native/tests/interop/cleaners/cleaners-main_thread.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/cleaners/cleaners-main_thread.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/interop/cleaners/cleaners-second_thread.out b/kotlin-native/backend.native/tests/interop/cleaners/cleaners-second_thread.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/cleaners/cleaners-second_thread.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/interop/cpp/skia.out b/kotlin-native/backend.native/tests/interop/cpp/skia.out new file mode 100644 index 00000000000..f374642cd70 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/cpp/skia.out @@ -0,0 +1,10 @@ +SkFoo() +SkData() +SkData() +SkValue() +SkData() +MANAGED: f: true, a: true, b: false, v: true, c: false +DATA: 17 19 17 17 +unref +~SkData() +~SkFoo() diff --git a/kotlin-native/backend.native/tests/interop/cpp/skiaSignature.out b/kotlin-native/backend.native/tests/interop/cpp/skiaSignature.out new file mode 100644 index 00000000000..cd28fca7396 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/cpp/skiaSignature.out @@ -0,0 +1,7 @@ +SkData() +SkData(19) +SkData(SkData*) +SkData(SkData*, SkData*) +SkData(200) +SkData(436) +true true true true true diff --git a/kotlin-native/backend.native/tests/interop/kt43502/main-main.out b/kotlin-native/backend.native/tests/interop/kt43502/main-main.out new file mode 100644 index 00000000000..19765bd501b --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/kt43502/main-main.out @@ -0,0 +1 @@ +null diff --git a/kotlin-native/backend.native/tests/interop/libiconv.out b/kotlin-native/backend.native/tests/interop/libiconv.out new file mode 100644 index 00000000000..0448a8f8b3f --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/libiconv.out @@ -0,0 +1,6 @@ +72 72 +101 101 +108 108 +108 108 +111 111 +33 33 diff --git a/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode.kt b/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_default.kt similarity index 100% rename from kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode.kt rename to kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_default.kt diff --git a/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_default.out b/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_default.out new file mode 100644 index 00000000000..57f3ce1c06a --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_default.out @@ -0,0 +1 @@ +OK: Ends with uncaught exception handler diff --git a/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_wrap.kt b/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_wrap.kt new file mode 100644 index 00000000000..722b614772f --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_wrap.kt @@ -0,0 +1,47 @@ +/* + * Test different behavior depending on foreignExceptionMode option + */ + +import kotlin.test.* +import objcExceptionMode.* +import kotlinx.cinterop.* +import platform.objc.* +import kotlin.system.exitProcess + +@Suppress("VARIABLE_WITH_REDUNDANT_INITIALIZER") +@Test fun testKT35056() { + val name = "Some native exception" + val reason = "Illegal value" + var finallyBlockTest = "FAILED" + var catchBlockTest = "FAILED" + try { + raiseExc(name, reason) + assertNotEquals("FAILED", catchBlockTest) // shall not get here anyway + } catch (e: ForeignException) { + val ret = logExc(e.nativeException) // return NSException name + assertEquals(name, ret) + assertEquals("$name:: $reason", e.message) + println("OK: ForeignException") + catchBlockTest = "PASSED" + } finally { + finallyBlockTest = "PASSED" + } + assertEquals("PASSED", catchBlockTest) + assertEquals("PASSED", finallyBlockTest) +} + +@Suppress("UNUSED_PARAMETER") +fun abnormal_handler(x: Any?) : Unit { + println("OK: Ends with uncaught exception handler") + exitProcess(0) +} + +fun main() { + // Depending on the `foreignxceptionMode` option (def file or cinterop cli) this test should ends + // normally with `ForeignException` handled or abnormally with `abnormal_handler`. + // Test shall validate output (golden value) from `abnormal_handler`. + + objc_setUncaughtExceptionHandler(staticCFunction(::abnormal_handler)) + + testKT35056() +} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_wrap.out b/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_wrap.out new file mode 100644 index 00000000000..40000985f0b --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc/foreignException/objcExceptionMode_wrap.out @@ -0,0 +1 @@ +OK: ForeignException diff --git a/kotlin-native/backend.native/tests/interop/objc/kt34467/foo.out b/kotlin-native/backend.native/tests/interop/objc/kt34467/foo.out new file mode 100644 index 00000000000..eb3d67546b0 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc/kt34467/foo.out @@ -0,0 +1,2 @@ +OK +42 diff --git a/kotlin-native/backend.native/tests/interop/objc/kt42172/main.out b/kotlin-native/backend.native/tests/interop/objc/kt42172/main.out new file mode 100644 index 00000000000..a69cc2df1a7 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc/kt42172/main.out @@ -0,0 +1 @@ +Executed finalizer diff --git a/kotlin-native/backend.native/tests/interop/objc/smoke.out b/kotlin-native/backend.native/tests/interop/objc/smoke.out new file mode 100644 index 00000000000..d6077bc8c48 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc/smoke.out @@ -0,0 +1,19 @@ +84 +Foo +Deallocated +Hello, World! +Kotlin says: Hello, everybody! +Hello from Kotlin +2, 1 +true +true +Global string +Another global string +null +global object +5 +String macro +CFString macro +Deallocated +Deallocated +Class TestExportObjCClass34 has multiple implementations. Which one will be used is undefined. diff --git a/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.kt b/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.kt new file mode 100644 index 00000000000..0408a0ea2d8 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.kt @@ -0,0 +1,240 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +import kotlinx.cinterop.* +import objcSmoke.* +import kotlin.native.concurrent.* +import kotlin.native.ref.* +import kotlin.test.* + +fun main(args: Array) { + // Test relies on full deinitialization at shutdown. + kotlin.native.internal.Debugging.forceCheckedShutdown = true + autoreleasepool { + run() + } +} + +fun run() { + // TODO: migrate remaining tests to interop/objc/tests/ + testTypeOps() + testCustomRetain() + testExportObjCClass() + testLocalizedStrings() + + assertEquals(2, ForwardDeclaredEnum.TWO.value) + + println( + getSupplier( + invoke1(42) { it * 2 } + )!!() + ) + + val foo = Foo() + + val classGetter = getClassGetter(foo) + invoke2 { println(classGetter()) } + + foo.hello() + foo.name = "everybody" + foo.helloWithPrinter(object : NSObject(), PrinterProtocol { + override fun print(string: CPointer?) { + println("Kotlin says: " + string?.toKString()) + } + }) + + Bar().hello() + + val pair = MutablePairImpl(42, 17) + replacePairElements(pair, 1, 2) + pair.swap() + println("${pair.first}, ${pair.second}") + + val defaultPair = MutablePairImpl() + assertEquals(defaultPair.first(), 123) + assertEquals(defaultPair.second(), 321) + + // equals and hashCode (virtually): + val map = mapOf(foo to pair, pair to foo) + + // equals (directly): + if (!foo.equals(pair)) { + // toString (directly): + println(map[pair].toString() + map[foo].toString() == foo.description() + pair.description()) + } + + // hashCode (directly): + // hash() returns value of NSUInteger type. + val hash = if (sizeOf() == 4L) { + foo.hash().toInt() + } else { + foo.hash().let { it.toInt() xor (it shr 32).toInt() } + } + if (foo.hashCode() == hash) { + // toString (virtually): + if (Platform.memoryModel == MemoryModel.STRICT) + println(map.keys.map { it.toString() }.minOrNull() == foo.description()) + else + // TODO: hack until proper cycle collection in maps. + println(true) + } + println(globalString) + autoreleasepool { + globalString = "Another global string" + } + println(globalString) + + println(globalObject) + globalObject = object : NSObject() { + override fun description() = "global object" + } + println(globalObject) + globalObject = null // Prevent Kotlin object above from leaking. + + println(formatStringLength("%d %d", 42, 17)) + + println(STRING_MACRO) + println(CFSTRING_MACRO) + + // Ensure that overriding method bridge has retain-autorelease sequence: + createObjectWithFactory(object : NSObject(), ObjectFactoryProtocol { + override fun create() = autoreleasepool { NSObject() } + }) + +} + +fun MutablePairProtocol.swap() { + update(0, add = second) + update(1, sub = first) + update(0, add = second) + update(1, sub = second*2) +} + +class Bar : Foo() { + override fun helloWithPrinter(printer: PrinterProtocol?) = memScoped { + printer!!.print("Hello from Kotlin".cstr.getPointer(memScope)) + } +} + +@Suppress("CONFLICTING_OVERLOADS") +class MutablePairImpl(first: Int, second: Int) : NSObject(), MutablePairProtocol { + private var elements = intArrayOf(first, second) + + override fun first() = elements.first() + override fun second() = elements.last() + + override fun update(index: Int, add: Int) { + elements[index] += add + } + + override fun update(index: Int, sub: Int) { + elements[index] -= sub + } + + constructor() : this(123, 321) +} + +interface Zzz + +fun testTypeOps() { + assertTrue(99.asAny() is NSNumber) + assertTrue(null.asAny() is NSNumber?) + assertFalse(null.asAny() is NSNumber) + assertFalse("".asAny() is NSNumber) + assertTrue("bar".asAny() is NSString) + + assertTrue(Foo.asAny() is FooMeta) + assertFalse(Foo.asAny() is Zzz) + assertTrue(Foo.asAny() is NSObjectMeta) + assertTrue(Foo.asAny() is NSObject) + assertFalse(Foo.asAny() is Foo) + assertTrue(NSString.asAny() is NSCopyingProtocolMeta) + assertFalse(NSString.asAny() is NSCopyingProtocol) + assertTrue(NSValue.asAny() is NSObjectProtocolMeta) + assertFalse(NSValue.asAny() is NSObjectProtocol) // Must be true, but not implemented properly yet. + + assertFalse(Any() is ObjCClass) + assertFalse(Any() is ObjCClassOf<*>) + assertFalse(NSObject().asAny() is ObjCClass) + assertFalse(NSObject().asAny() is ObjCClassOf<*>) + assertTrue(NSObject.asAny() is ObjCClass) + assertTrue(NSObject.asAny() is ObjCClassOf<*>) + + assertFalse(Any() is ObjCProtocol) + assertTrue(getPrinterProtocolRaw() is ObjCProtocol) + val printerProtocol = getPrinterProtocol()!! + assertTrue(printerProtocol.asAny() is ObjCProtocol) + + assertEquals(3u, ("foo" as NSString).length()) + assertEquals(4u, ((1..4).joinToString("") as NSString).length()) + assertEquals(2u, (listOf(0, 1) as NSArray).count()) + assertEquals(42L, (42 as NSNumber).longLongValue()) + + assertFails { "bar" as NSNumber } + assertFails { 42 as NSArray } + assertFails { listOf(1) as NSString } + assertFails { NSObject() as Bar } + assertFails { NSObject() as NSValue } + + MutablePairImpl(1, 2).asAny() as MutablePairProtocol + assertFails { MutablePairImpl(1, 2).asAny() as Foo } +} + +private lateinit var retainedMustNotBeDeallocated: MustNotBeDeallocated + +fun testCustomRetain() { + fun test() { + useCustomRetainMethods(object : Foo(), CustomRetainMethodsProtocol { + override fun returnRetained(obj: Any?) = obj + override fun consume(obj: Any?) {} + override fun consumeSelf() {} + override fun returnRetainedBlock(block: (() -> Unit)?) = block + }) + + CustomRetainMethodsImpl().let { + it.returnRetained(Any()) + retainedMustNotBeDeallocated = MustNotBeDeallocated() // Retain to detect possible over-release. + it.consume(retainedMustNotBeDeallocated) + it.consumeSelf() + it.returnRetainedBlock({})!!() + } + } + + autoreleasepool { + test() + kotlin.native.internal.GC.collect() + } + + assertFalse(unexpectedDeallocation) +} + +private const val TestExportObjCClass1Name = "TestExportObjCClass" +@ExportObjCClass(TestExportObjCClass1Name) class TestExportObjCClass1 : NSObject() + +@ExportObjCClass class TestExportObjCClass2 : NSObject() + +const val TestExportObjCClass34Name = "TestExportObjCClass34" +@ExportObjCClass(TestExportObjCClass34Name) class TestExportObjCClass3 : NSObject() +@ExportObjCClass(TestExportObjCClass34Name) class TestExportObjCClass4 : NSObject() + +fun testExportObjCClass() { + assertEquals(TestExportObjCClass1Name, TestExportObjCClass1().objCClassName) + assertEquals("TestExportObjCClass2", TestExportObjCClass2().objCClassName) + + assertTrue((TestExportObjCClass3().objCClassName == TestExportObjCClass34Name) + xor (TestExportObjCClass4().objCClassName == TestExportObjCClass34Name)) +} + +fun testLocalizedStrings() { + val key = "screen_main_plural_string" + val localizedString = NSBundle.mainBundle.localizedStringForKey(key, value = "", table = "Localizable") + val string = NSString.localizedStringWithFormat(localizedString, 5) + assertEquals("Plural: 5 apples", string) +} + +private val Any.objCClassName: String + get() = object_getClassName(this)!!.toKString() + +fun Any?.asAny(): Any? = this diff --git a/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.out b/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.out new file mode 100644 index 00000000000..7ecfd937c7f --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.out @@ -0,0 +1,18 @@ +84 +Foo +Hello, World! +Kotlin says: Hello, everybody! +Hello from Kotlin +2, 1 +true +true +Global string +Another global string +null +global object +5 +String macro +CFString macro +Deallocated +Deallocated +Class TestExportObjCClass34 has multiple implementations. Which one will be used is undefined. diff --git a/kotlin-native/backend.native/tests/interop/objc_arc_contract/main.out b/kotlin-native/backend.native/tests/interop/objc_arc_contract/main.out new file mode 100644 index 00000000000..9766475a418 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc_arc_contract/main.out @@ -0,0 +1 @@ +ok diff --git a/kotlin-native/backend.native/tests/interop/objc_with_initializer/objc_test.out b/kotlin-native/backend.native/tests/interop/objc_with_initializer/objc_test.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/objc_with_initializer/objc_test.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/interop/platform_zlib.out b/kotlin-native/backend.native/tests/interop/platform_zlib.out new file mode 100644 index 00000000000..d27134875b8 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/platform_zlib.out @@ -0,0 +1,2 @@ +Hello! +Hello! diff --git a/kotlin-native/backend.native/tests/jsinterop/math.out b/kotlin-native/backend.native/tests/jsinterop/math.out new file mode 100644 index 00000000000..54ecd4c0b51 --- /dev/null +++ b/kotlin-native/backend.native/tests/jsinterop/math.out @@ -0,0 +1 @@ +e = 2.718281828459045, pi = 3.141592653589793, sin(pi) = 1.2246467991473532E-16, sin(pi/2) = 1.0, ln(1) = 0.0, ln(e) = 1.0 diff --git a/kotlin-native/backend.native/tests/link/default/default.out b/kotlin-native/backend.native/tests/link/default/default.out new file mode 100644 index 00000000000..1fa3400dba9 --- /dev/null +++ b/kotlin-native/backend.native/tests/link/default/default.out @@ -0,0 +1 @@ +sizet = 0 diff --git a/kotlin-native/backend.native/tests/link/fake_overrides/main.out b/kotlin-native/backend.native/tests/link/fake_overrides/main.out new file mode 100644 index 00000000000..2c35a51fa66 --- /dev/null +++ b/kotlin-native/backend.native/tests/link/fake_overrides/main.out @@ -0,0 +1,4 @@ +Moved +Moved +Child +Super diff --git a/kotlin-native/backend.native/tests/link/omit/lib.kt b/kotlin-native/backend.native/tests/link/omit/library.kt similarity index 100% rename from kotlin-native/backend.native/tests/link/omit/lib.kt rename to kotlin-native/backend.native/tests/link/omit/library.kt diff --git a/kotlin-native/backend.native/tests/link/omit/hello.kt b/kotlin-native/backend.native/tests/link/omit/main.kt similarity index 100% rename from kotlin-native/backend.native/tests/link/omit/hello.kt rename to kotlin-native/backend.native/tests/link/omit/main.kt diff --git a/kotlin-native/backend.native/tests/link/omit/main.out b/kotlin-native/backend.native/tests/link/omit/main.out new file mode 100644 index 00000000000..e965047ad7c --- /dev/null +++ b/kotlin-native/backend.native/tests/link/omit/main.out @@ -0,0 +1 @@ +Hello diff --git a/kotlin-native/backend.native/tests/link/private_fake_overrides/inherit_main.out b/kotlin-native/backend.native/tests/link/private_fake_overrides/inherit_main.out new file mode 100644 index 00000000000..40f949f4c16 --- /dev/null +++ b/kotlin-native/backend.native/tests/link/private_fake_overrides/inherit_main.out @@ -0,0 +1,10 @@ +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS diff --git a/kotlin-native/backend.native/tests/link/private_fake_overrides/override_main.out b/kotlin-native/backend.native/tests/link/private_fake_overrides/override_main.out new file mode 100644 index 00000000000..985f61431ac --- /dev/null +++ b/kotlin-native/backend.native/tests/link/private_fake_overrides/override_main.out @@ -0,0 +1,17 @@ +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS +PASS diff --git a/kotlin-native/backend.native/tests/link/purge1/prog.out b/kotlin-native/backend.native/tests/link/purge1/prog.out new file mode 100644 index 00000000000..602c1f38930 --- /dev/null +++ b/kotlin-native/backend.native/tests/link/purge1/prog.out @@ -0,0 +1,2 @@ +linked library +and symbols from posix available: 17; 1.0 diff --git a/kotlin-native/backend.native/tests/link/src/bar.out b/kotlin-native/backend.native/tests/link/src/bar.out new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/kotlin-native/backend.native/tests/link/src/bar.out @@ -0,0 +1 @@ +0 diff --git a/kotlin-native/backend.native/tests/link/testLib_explicitly1.kt b/kotlin-native/backend.native/tests/link/testLib_explicitly1.kt new file mode 100644 index 00000000000..32d0b4ceb4d --- /dev/null +++ b/kotlin-native/backend.native/tests/link/testLib_explicitly1.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +fun main(args: Array) { + println("Hello") +} diff --git a/kotlin-native/backend.native/tests/link/testLib_explicitly1.out b/kotlin-native/backend.native/tests/link/testLib_explicitly1.out new file mode 100644 index 00000000000..e965047ad7c --- /dev/null +++ b/kotlin-native/backend.native/tests/link/testLib_explicitly1.out @@ -0,0 +1 @@ +Hello diff --git a/kotlin-native/backend.native/tests/link/testLib_explicitly2.kt b/kotlin-native/backend.native/tests/link/testLib_explicitly2.kt new file mode 100644 index 00000000000..32d0b4ceb4d --- /dev/null +++ b/kotlin-native/backend.native/tests/link/testLib_explicitly2.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +fun main(args: Array) { + println("Hello") +} diff --git a/kotlin-native/backend.native/tests/link/testLib_explicitly2.out b/kotlin-native/backend.native/tests/link/testLib_explicitly2.out new file mode 100644 index 00000000000..075c8a88318 --- /dev/null +++ b/kotlin-native/backend.native/tests/link/testLib_explicitly2.out @@ -0,0 +1,4 @@ +This is a side effect of a test library linked into the binary. +You should not be seeing this. + +Hello diff --git a/kotlin-native/backend.native/tests/lower/immutable_blob_in_lambda.out b/kotlin-native/backend.native/tests/lower/immutable_blob_in_lambda.out new file mode 100644 index 00000000000..190a18037c6 --- /dev/null +++ b/kotlin-native/backend.native/tests/lower/immutable_blob_in_lambda.out @@ -0,0 +1 @@ +123 diff --git a/kotlin-native/backend.native/tests/lower/tailrec.out b/kotlin-native/backend.native/tests/lower/tailrec.out new file mode 100644 index 00000000000..8e46f90da7c --- /dev/null +++ b/kotlin-native/backend.native/tests/lower/tailrec.out @@ -0,0 +1,14 @@ +12 +100000000 +8 +1 +3 ... +2 ... +1 ... +ready! +2 +-1 +true +false +default +42 diff --git a/kotlin-native/backend.native/tests/lower/vararg_of_literals.out b/kotlin-native/backend.native/tests/lower/vararg_of_literals.out new file mode 100644 index 00000000000..7e8a1653bf2 --- /dev/null +++ b/kotlin-native/backend.native/tests/lower/vararg_of_literals.out @@ -0,0 +1,2 @@ +a +a diff --git a/kotlin-native/backend.native/tests/mangling/mangling.out b/kotlin-native/backend.native/tests/mangling/mangling.out new file mode 100644 index 00000000000..a0f68dcf468 --- /dev/null +++ b/kotlin-native/backend.native/tests/mangling/mangling.out @@ -0,0 +1,9 @@ +Int direct [1, 2, 3, 4] +out Number direct [9, 10, 11, 12] +star direct [5, 6, 7, 8] +Int param [1, 2, 3, 4] +out Number param [9, 10, 11, 12] +star param [5, 6, 7, 8] +no constructors {} +single constructor some string +two constructors 17 diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main-main.out b/kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main-main.out new file mode 100644 index 00000000000..3c89cf5d664 --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main-main.out @@ -0,0 +1,6 @@ +CFoo1::extfoo +CFoo1::extfoo +CFoo2::extfoo +CFoo2::extfoo +Int::extfoo +Int::extfoo diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-0-main.out b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-0-main.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-1-main.out b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-1-main.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-2-main.out b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-2-main.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/produce_dynamic/simple/hello-main.out b/kotlin-native/backend.native/tests/produce_dynamic/simple/hello-main.out new file mode 100644 index 00000000000..c265c245cbf --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/simple/hello-main.out @@ -0,0 +1,20 @@ +Hello, dynamic! +Base.foo +Base.fooParam: a 1 q +Child.fooParam: b 2 null +Child.fooParam: c 3 null +Impl1.I: d 4 Impl1 +Impl2.I: e 5 Impl2 +String is Kotlin/Native nullable is Hi null is OK +RO property is 42 +RW property is 239 +enum100 = 100 +enum42 = 42 +object = 42 +singleton = I am single +mutable = foo +topLevel = 777 3 +IsInstance1 = PASS +IsInstance2 = PASS +getVector128 = (1, 2, 3, 4) +Error handler: kotlin.Error: Expected error diff --git a/kotlin-native/backend.native/tests/runtime/basic/args0.out b/kotlin-native/backend.native/tests/runtime/basic/args0.out new file mode 100644 index 00000000000..df417d65308 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/args0.out @@ -0,0 +1,3 @@ +AAA +BB +C diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_with_checker.out b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_with_checker.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_with_checker.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_without_checker.out b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_without_checker.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_without_checker.out b/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_without_checker.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/runtime/basic/driver0.out b/kotlin-native/backend.native/tests/runtime/basic/driver0.out new file mode 100644 index 00000000000..af5626b4a11 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/driver0.out @@ -0,0 +1 @@ +Hello, world! diff --git a/kotlin-native/backend.native/tests/runtime/basic/driver_opt.kt b/kotlin-native/backend.native/tests/runtime/basic/driver_opt.kt new file mode 100644 index 00000000000..4feb92951c3 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/driver_opt.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +// TODO: remove kotlin_native.io once overrides are in place. +fun main(args : Array) { + println("Hello, world!") +} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/driver_opt.out b/kotlin-native/backend.native/tests/runtime/basic/driver_opt.out new file mode 100644 index 00000000000..af5626b4a11 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/driver_opt.out @@ -0,0 +1 @@ +Hello, world! diff --git a/kotlin-native/backend.native/tests/runtime/basic/empty_substring.out b/kotlin-native/backend.native/tests/runtime/basic/empty_substring.out new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/empty_substring.out @@ -0,0 +1 @@ + diff --git a/kotlin-native/backend.native/tests/runtime/basic/entry0.out b/kotlin-native/backend.native/tests/runtime/basic/entry0.out new file mode 100644 index 00000000000..18832d35117 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/entry0.out @@ -0,0 +1 @@ +Hello. diff --git a/kotlin-native/backend.native/tests/runtime/basic/entry1.out b/kotlin-native/backend.native/tests/runtime/basic/entry1.out new file mode 100644 index 00000000000..18832d35117 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/entry1.out @@ -0,0 +1 @@ +Hello. diff --git a/kotlin-native/backend.native/tests/runtime/basic/entry2.out b/kotlin-native/backend.native/tests/runtime/basic/entry2.out new file mode 100644 index 00000000000..18832d35117 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/entry2.out @@ -0,0 +1 @@ +Hello. diff --git a/kotlin-native/backend.native/tests/runtime/basic/entry3.kt b/kotlin-native/backend.native/tests/runtime/basic/entry3.kt new file mode 100644 index 00000000000..53ba7d1b8a4 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/entry3.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +fun fail() { + println("Test failed, this is a wrong main() function.") +} + +fun foo(args: Array) { + println("Hello.") +} + +fun bar() { + println("Hello, without args.") +} + + +fun main(args: Array) { + fail() +} + diff --git a/kotlin-native/backend.native/tests/runtime/basic/entry3.out b/kotlin-native/backend.native/tests/runtime/basic/entry3.out new file mode 100644 index 00000000000..a0874b3c043 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/entry3.out @@ -0,0 +1 @@ +Hello, without args. diff --git a/kotlin-native/backend.native/tests/runtime/basic/entry4.out b/kotlin-native/backend.native/tests/runtime/basic/entry4.out new file mode 100644 index 00000000000..da5cf725571 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/entry4.out @@ -0,0 +1 @@ +This is main without args diff --git a/kotlin-native/backend.native/tests/runtime/basic/enum_equals.out b/kotlin-native/backend.native/tests/runtime/basic/enum_equals.out new file mode 100644 index 00000000000..36bc6136b8b --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/enum_equals.out @@ -0,0 +1,3 @@ +true +false +false diff --git a/kotlin-native/backend.native/tests/runtime/basic/for0.out b/kotlin-native/backend.native/tests/runtime/basic/for0.out new file mode 100644 index 00000000000..dcf37cd5e26 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/for0.out @@ -0,0 +1,3 @@ +2 +3 +4 diff --git a/kotlin-native/backend.native/tests/runtime/basic/hash0.out b/kotlin-native/backend.native/tests/runtime/basic/hash0.out new file mode 100644 index 00000000000..ea08c8f27e1 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/hash0.out @@ -0,0 +1,9 @@ +239 +0 +97 +1065353216 +1072693248 +1 +0 +true +true diff --git a/kotlin-native/backend.native/tests/runtime/basic/hello0.out b/kotlin-native/backend.native/tests/runtime/basic/hello0.out new file mode 100644 index 00000000000..af5626b4a11 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/hello0.out @@ -0,0 +1 @@ +Hello, world! diff --git a/kotlin-native/backend.native/tests/runtime/basic/hello1.out b/kotlin-native/backend.native/tests/runtime/basic/hello1.out new file mode 100644 index 00000000000..5e1c309dae7 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/hello1.out @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/hello2.out b/kotlin-native/backend.native/tests/runtime/basic/hello2.out new file mode 100644 index 00000000000..6bfe6aa6ce3 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/hello2.out @@ -0,0 +1 @@ +you entered 'Hello World' \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/hello3.out b/kotlin-native/backend.native/tests/runtime/basic/hello3.out new file mode 100644 index 00000000000..e6739c2ed25 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/hello3.out @@ -0,0 +1,4 @@ +239 +true +3.14159 +A diff --git a/kotlin-native/backend.native/tests/runtime/basic/hello4.out b/kotlin-native/backend.native/tests/runtime/basic/hello4.out new file mode 100644 index 00000000000..74075eaa752 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/hello4.out @@ -0,0 +1,2 @@ +Hello +Пока diff --git a/kotlin-native/backend.native/tests/runtime/basic/ieee754.out b/kotlin-native/backend.native/tests/runtime/basic/ieee754.out new file mode 100644 index 00000000000..90793410eca --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/ieee754.out @@ -0,0 +1,16 @@ +Infinity 2147483647 -1 +3.4028235E38 +NAN2SHORT:: 0 +2147483647 -1 +FLOAT:: Infinity INT:: 2147483647 +FLOAT:: 1.7014117E38 INT:: 2147483647 +FLOAT:: 3.4028235E38 INT:: 2147483647 +FLOAT:: 3.14 INT:: 3 +FLOAT:: NaN INT:: 0 +FLOAT:: -33333.125 INT:: -33333 +FLOAT:: 1.4E-45 INT:: 0 +FLOAT:: -Infinity INT:: -2147483648 +FLOAT:: -1.2 INT:: -1 +FLOAT:: -12.6 INT:: -12 +FLOAT:: 2.3 INT:: 2 +OK diff --git a/kotlin-native/backend.native/tests/runtime/basic/initializers0.out b/kotlin-native/backend.native/tests/runtime/basic/initializers0.out new file mode 100644 index 00000000000..8ebbef5c0bf --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/initializers0.out @@ -0,0 +1,10 @@ +main +B::constructor(1) +A::companion +A::companion::foo +A::companion::foo +B::constructor(0) +B::constructor() +A::Obj +A::AObj::foo +A::AObj::foo diff --git a/kotlin-native/backend.native/tests/runtime/basic/initializers1.out b/kotlin-native/backend.native/tests/runtime/basic/initializers1.out new file mode 100644 index 00000000000..4caa0b26ce0 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/initializers1.out @@ -0,0 +1,2 @@ +Init Test +Done diff --git a/kotlin-native/backend.native/tests/runtime/basic/initializers2.out b/kotlin-native/backend.native/tests/runtime/basic/initializers2.out new file mode 100644 index 00000000000..ce3a707ebb8 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/initializers2.out @@ -0,0 +1,5 @@ +init globalValue2 +init globalValue3 +1 +globalValue2 +globalValue3 diff --git a/kotlin-native/backend.native/tests/runtime/basic/initializers3.out b/kotlin-native/backend.native/tests/runtime/basic/initializers3.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/initializers3.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/runtime/basic/initializers4.out b/kotlin-native/backend.native/tests/runtime/basic/initializers4.out new file mode 100644 index 00000000000..0dc48ae95d2 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/initializers4.out @@ -0,0 +1,2 @@ +1073741824 +true diff --git a/kotlin-native/backend.native/tests/runtime/basic/initializers5.out b/kotlin-native/backend.native/tests/runtime/basic/initializers5.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/initializers5.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/runtime/basic/interface0.out b/kotlin-native/backend.native/tests/runtime/basic/interface0.out new file mode 100644 index 00000000000..53cdf1e9393 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/interface0.out @@ -0,0 +1 @@ +PASSED diff --git a/kotlin-native/backend.native/tests/runtime/basic/readline0.out b/kotlin-native/backend.native/tests/runtime/basic/readline0.out new file mode 100644 index 00000000000..aaa6442fe90 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/readline0.out @@ -0,0 +1 @@ +41 \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/readline1.out b/kotlin-native/backend.native/tests/runtime/basic/readline1.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/runtime/basic/statements0.out b/kotlin-native/backend.native/tests/runtime/basic/statements0.out new file mode 100644 index 00000000000..8b3ced58d3a --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/statements0.out @@ -0,0 +1,4 @@ +239 +238 +30 +29 diff --git a/kotlin-native/backend.native/tests/runtime/basic/throw0.out b/kotlin-native/backend.native/tests/runtime/basic/throw0.out new file mode 100644 index 00000000000..a965a70ed4e --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/throw0.out @@ -0,0 +1 @@ +Done diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring0.out b/kotlin-native/backend.native/tests/runtime/basic/tostring0.out new file mode 100644 index 00000000000..68b0937df27 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/tostring0.out @@ -0,0 +1,14 @@ +127 +-1 +239 +A +Ё +ト +1122334455 +112233445566778899 +3.14159265358 +1.0E27 +1.0E7 +1.0E-300 +true +false diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring1.out b/kotlin-native/backend.native/tests/runtime/basic/tostring1.out new file mode 100644 index 00000000000..994dae62780 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/tostring1.out @@ -0,0 +1 @@ +ello diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring2.out b/kotlin-native/backend.native/tests/runtime/basic/tostring2.out new file mode 100644 index 00000000000..2d952063a9e --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/tostring2.out @@ -0,0 +1,2 @@ +H e l l o +Hello diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring3.out b/kotlin-native/backend.native/tests/runtime/basic/tostring3.out new file mode 100644 index 00000000000..a41c92b37a3 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/basic/tostring3.out @@ -0,0 +1,18 @@ +-128 +127 +-32768 +32767 +-2147483648 +2147483647 +-9223372036854775808 +9223372036854775807 +1.4E-45 +3.4028235E38 +-Infinity +Infinity +NaN +4.9E-324 +1.7976931348623157E308 +-Infinity +Infinity +NaN diff --git a/kotlin-native/backend.native/tests/runtime/collections/array0.out b/kotlin-native/backend.native/tests/runtime/collections/array0.out new file mode 100644 index 00000000000..510c6ba7308 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/array0.out @@ -0,0 +1,9 @@ +5 +6 +7 +8 +9 +10 +11 +12 +13 diff --git a/kotlin-native/backend.native/tests/runtime/collections/array1.out b/kotlin-native/backend.native/tests/runtime/collections/array1.out new file mode 100644 index 00000000000..925e4c595b7 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/array1.out @@ -0,0 +1,4 @@ +4 2 +1-1 +69 +38 diff --git a/kotlin-native/backend.native/tests/runtime/collections/array2.out b/kotlin-native/backend.native/tests/runtime/collections/array2.out new file mode 100644 index 00000000000..fd6332808f8 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/array2.out @@ -0,0 +1,6 @@ +0 +2 +4 +6 +8 +40 diff --git a/kotlin-native/backend.native/tests/runtime/collections/array3.out b/kotlin-native/backend.native/tests/runtime/collections/array3.out new file mode 100644 index 00000000000..14a555d0402 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/array3.out @@ -0,0 +1,2 @@ +1 2 3 7 8 9 -128 -1 +1 2 3 7 8 9 -128 -1 diff --git a/kotlin-native/backend.native/tests/runtime/collections/array4.out b/kotlin-native/backend.native/tests/runtime/collections/array4.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/array4.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/collections/array_list1.out b/kotlin-native/backend.native/tests/runtime/collections/array_list1.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/array_list1.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/collections/array_list2.out b/kotlin-native/backend.native/tests/runtime/collections/array_list2.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/array_list2.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/collections/hash_map0.out b/kotlin-native/backend.native/tests/runtime/collections/hash_map0.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/hash_map0.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/collections/hash_map1.out b/kotlin-native/backend.native/tests/runtime/collections/hash_map1.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/hash_map1.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/collections/hash_set0.out b/kotlin-native/backend.native/tests/runtime/collections/hash_set0.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/hash_set0.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/collections/listof0.out b/kotlin-native/backend.native/tests/runtime/collections/listof0.out new file mode 100644 index 00000000000..2a210a1d9b0 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/listof0.out @@ -0,0 +1,3 @@ +abc +[a, b, c, d] +[n, s, a] diff --git a/kotlin-native/backend.native/tests/runtime/collections/moderately_large_array.out b/kotlin-native/backend.native/tests/runtime/collections/moderately_large_array.out new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/moderately_large_array.out @@ -0,0 +1 @@ +0 diff --git a/kotlin-native/backend.native/tests/runtime/collections/moderately_large_array1.out b/kotlin-native/backend.native/tests/runtime/collections/moderately_large_array1.out new file mode 100644 index 00000000000..227c967f196 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/moderately_large_array1.out @@ -0,0 +1 @@ +-45392 diff --git a/kotlin-native/backend.native/tests/runtime/collections/range0.out b/kotlin-native/backend.native/tests/runtime/collections/range0.out new file mode 100644 index 00000000000..7258d74f9c6 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/range0.out @@ -0,0 +1,2 @@ +123 +abcd diff --git a/kotlin-native/backend.native/tests/runtime/collections/sort0.out b/kotlin-native/backend.native/tests/runtime/collections/sort0.out new file mode 100644 index 00000000000..541955d2e8e --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/sort0.out @@ -0,0 +1,2 @@ +[a, b, x] +[-1, 0, 42, 239, 100500] diff --git a/kotlin-native/backend.native/tests/runtime/collections/sort1.out b/kotlin-native/backend.native/tests/runtime/collections/sort1.out new file mode 100644 index 00000000000..541955d2e8e --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/sort1.out @@ -0,0 +1,2 @@ +[a, b, x] +[-1, 0, 42, 239, 100500] diff --git a/kotlin-native/backend.native/tests/runtime/collections/stack_array.out b/kotlin-native/backend.native/tests/runtime/collections/stack_array.out new file mode 100644 index 00000000000..d65bc6d6ad1 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/stack_array.out @@ -0,0 +1,2 @@ +true +3 diff --git a/kotlin-native/backend.native/tests/runtime/collections/typed_array0.out b/kotlin-native/backend.native/tests/runtime/collections/typed_array0.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/typed_array0.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/collections/typed_array1.out b/kotlin-native/backend.native/tests/runtime/collections/typed_array1.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/collections/typed_array1.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/catch1.out b/kotlin-native/backend.native/tests/runtime/exceptions/catch1.out new file mode 100644 index 00000000000..6bd4ef2c642 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/exceptions/catch1.out @@ -0,0 +1,3 @@ +Before +Caught Throwable +Done diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/catch2.out b/kotlin-native/backend.native/tests/runtime/exceptions/catch2.out new file mode 100644 index 00000000000..5b328e91afc --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/exceptions/catch2.out @@ -0,0 +1,3 @@ +Before +Caught Error +Done diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/catch7.out b/kotlin-native/backend.native/tests/runtime/exceptions/catch7.out new file mode 100644 index 00000000000..a267b9d963b --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/exceptions/catch7.out @@ -0,0 +1 @@ +Error happens diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.out b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/extend0.out b/kotlin-native/backend.native/tests/runtime/exceptions/extend0.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/exceptions/extend0.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/memory/cycles0.out b/kotlin-native/backend.native/tests/runtime/memory/cycles0.out new file mode 100644 index 00000000000..d81cc0710eb --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/memory/cycles0.out @@ -0,0 +1 @@ +42 diff --git a/kotlin-native/backend.native/tests/runtime/memory/escape1.out b/kotlin-native/backend.native/tests/runtime/memory/escape1.out new file mode 100644 index 00000000000..b1a17ba1369 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/memory/escape1.out @@ -0,0 +1 @@ +zzz diff --git a/kotlin-native/backend.native/tests/runtime/memory/escape2.out b/kotlin-native/backend.native/tests/runtime/memory/escape2.out new file mode 100644 index 00000000000..b1a17ba1369 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/memory/escape2.out @@ -0,0 +1 @@ +zzz diff --git a/kotlin-native/backend.native/tests/runtime/memory/throw_cleanup.out b/kotlin-native/backend.native/tests/runtime/memory/throw_cleanup.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/memory/throw_cleanup.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/runtime/memory/weak0.out b/kotlin-native/backend.native/tests/runtime/memory/weak0.out new file mode 100644 index 00000000000..39ec2141cb3 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/memory/weak0.out @@ -0,0 +1,3 @@ +Data(s=Hello) +null +OK diff --git a/kotlin-native/backend.native/tests/runtime/memory/weak1.out b/kotlin-native/backend.native/tests/runtime/memory/weak1.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/memory/weak1.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/text/string0.out b/kotlin-native/backend.native/tests/runtime/text/string0.out new file mode 100644 index 00000000000..305ef9c1e26 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/text/string0.out @@ -0,0 +1,6 @@ +true +true +ПРИВЕТ +привет +Пока +true diff --git a/kotlin-native/backend.native/tests/runtime/text/string_builder0.out b/kotlin-native/backend.native/tests/runtime/text/string_builder0.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/text/string_builder0.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/text/string_builder1.out b/kotlin-native/backend.native/tests/runtime/text/string_builder1.out new file mode 100644 index 00000000000..35ef9390476 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/text/string_builder1.out @@ -0,0 +1,5 @@ +HelloKotlin +42 +0.1 +true + diff --git a/kotlin-native/backend.native/tests/runtime/text/to_string0.out b/kotlin-native/backend.native/tests/runtime/text/to_string0.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/text/to_string0.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/text/trim.out b/kotlin-native/backend.native/tests/runtime/text/trim.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/text/trim.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/text/utf8.out b/kotlin-native/backend.native/tests/runtime/text/utf8.out new file mode 100644 index 00000000000..ee8acd96199 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/text/utf8.out @@ -0,0 +1,10 @@ +Hello +Привет +𐀀 + +�� +�12 +�12 +12� +😥 +😥 diff --git a/kotlin-native/backend.native/tests/runtime/workers/atomic0.out b/kotlin-native/backend.native/tests/runtime/workers/atomic0.out new file mode 100644 index 00000000000..3cb3acfc7d5 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/atomic0.out @@ -0,0 +1,3 @@ +35 +20 +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/enum_identity.out b/kotlin-native/backend.native/tests/runtime/workers/enum_identity.out new file mode 100644 index 00000000000..27ba77ddaf6 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/enum_identity.out @@ -0,0 +1 @@ +true diff --git a/kotlin-native/backend.native/tests/runtime/workers/freeze0.out b/kotlin-native/backend.native/tests/runtime/workers/freeze0.out new file mode 100644 index 00000000000..b7f896936ad --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/freeze0.out @@ -0,0 +1,4 @@ +frozen bit is true +Worker: SharedData(string=Hello, int=10, member=SharedDataMember(double=0.1)) +Main: SharedData(string=Hello, int=10, member=SharedDataMember(double=0.1)) +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/freeze1.out b/kotlin-native/backend.native/tests/runtime/workers/freeze1.out new file mode 100644 index 00000000000..0d08b329132 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/freeze1.out @@ -0,0 +1 @@ +OK, cannot mutate frozen diff --git a/kotlin-native/backend.native/tests/runtime/workers/freeze2.out b/kotlin-native/backend.native/tests/runtime/workers/freeze2.out new file mode 100644 index 00000000000..bb2e80aa642 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/freeze2.out @@ -0,0 +1,5 @@ +Worker 1: Hello world +Worker2: 42 +Worker3: 239.0 +Worker4: a +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/freeze3.out b/kotlin-native/backend.native/tests/runtime/workers/freeze3.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/freeze3.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/freeze4.out b/kotlin-native/backend.native/tests/runtime/workers/freeze4.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/freeze4.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/freeze5.out b/kotlin-native/backend.native/tests/runtime/workers/freeze5.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/freeze5.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/freeze6.out b/kotlin-native/backend.native/tests/runtime/workers/freeze6.out new file mode 100644 index 00000000000..2c94e483710 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/freeze6.out @@ -0,0 +1,2 @@ +OK +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/freeze_stress.out b/kotlin-native/backend.native/tests/runtime/workers/freeze_stress.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/freeze_stress.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/lazy0.out b/kotlin-native/backend.native/tests/runtime/workers/lazy0.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/lazy0.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/lazy1.out b/kotlin-native/backend.native/tests/runtime/workers/lazy1.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/lazy1.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/lazy2.out b/kotlin-native/backend.native/tests/runtime/workers/lazy2.out new file mode 100644 index 00000000000..f49db2498c6 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/lazy2.out @@ -0,0 +1,2 @@ +123 +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker0.out b/kotlin-native/backend.native/tests/runtime/workers/worker0.out new file mode 100644 index 00000000000..1276792036f --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker0.out @@ -0,0 +1,2 @@ +Got Input processed +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker1.out b/kotlin-native/backend.native/tests/runtime/workers/worker1.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker1.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker10.out b/kotlin-native/backend.native/tests/runtime/workers/worker10.out new file mode 100644 index 00000000000..acd7baef4f3 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker10.out @@ -0,0 +1,3 @@ +OK +true +true diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker11.out b/kotlin-native/backend.native/tests/runtime/workers/worker11.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker11.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker2.out b/kotlin-native/backend.native/tests/runtime/workers/worker2.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker2.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker3.out b/kotlin-native/backend.native/tests/runtime/workers/worker3.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker3.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker4.out b/kotlin-native/backend.native/tests/runtime/workers/worker4.out new file mode 100644 index 00000000000..e40dd2ee66e --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker4.out @@ -0,0 +1,2 @@ +Got 42 +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker5.out b/kotlin-native/backend.native/tests/runtime/workers/worker5.out new file mode 100644 index 00000000000..ee5b59aacf2 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker5.out @@ -0,0 +1,2 @@ +Got 3 +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker6.out b/kotlin-native/backend.native/tests/runtime/workers/worker6.out new file mode 100644 index 00000000000..e40dd2ee66e --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker6.out @@ -0,0 +1,2 @@ +Got 42 +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker7.out b/kotlin-native/backend.native/tests/runtime/workers/worker7.out new file mode 100644 index 00000000000..7d6a8aafdfd --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker7.out @@ -0,0 +1,3 @@ +Input +Got kotlin.Unit +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker8.out b/kotlin-native/backend.native/tests/runtime/workers/worker8.out new file mode 100644 index 00000000000..6b172c1a83d --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker8.out @@ -0,0 +1,3 @@ +SharedData(string=Hello, int=10, member=SharedDataMember(double=0.1)) +Got kotlin.Unit +OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker9.out b/kotlin-native/backend.native/tests/runtime/workers/worker9.out new file mode 100644 index 00000000000..5de80692a48 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker9.out @@ -0,0 +1,6 @@ +zzz +42 +OK +first 2 +second 3 +frozen OK diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.kt b/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.kt new file mode 100644 index 00000000000..2fe14beb890 --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.kt @@ -0,0 +1,90 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +package runtime.workers.worker9_experimentalMM + +import kotlin.test.* + +import kotlin.native.concurrent.* + +@Test fun runTest1() { + withLock { println("zzz") } + val worker = Worker.start() + val future = worker.execute(TransferMode.SAFE, {}) { + withLock { + println("42") + } + } + future.result + worker.requestTermination().result + println("OK") +} + +fun withLock(op: () -> Unit) { + op() +} + +@Test fun runTest2() { + val worker = Worker.start() + val future = worker.execute(TransferMode.SAFE, {}) { + val me = Worker.current + var x = 1 + me.executeAfter (20000) { + println("second ${++x}") + } + me.executeAfter(10000) { + println("first ${++x}") + } + } + worker.requestTermination().result +} + +@Test fun runTest3() { + val worker = Worker.start() + if (Platform.memoryModel == MemoryModel.EXPERIMENTAL) { + worker.executeAfter { + println("unfrozen OK") + } + } else { + assertFailsWith { + worker.executeAfter { + println("shall not happen") + } + } + } + assertFailsWith { + worker.executeAfter(-1, { + println("shall not happen") + }.freeze()) + } + + worker.executeAfter(0, { + println("frozen OK") + }.freeze()) + + worker.requestTermination().result +} + +class Node(var node: Node?, var outher: Node?) + +fun makeCyclic(): Node { + val inner = Node(null, null) + inner.node = inner + val outer = Node(null, null) + inner.outher = outer + return outer +} + +@Test fun runTest4() { + val worker = Worker.start() + + val future = worker.execute(TransferMode.SAFE, { }) { + makeCyclic().also { + kotlin.native.internal.GC.collect() + } + } + assert(future.result != null) + worker.requestTermination().result +} diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.out b/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.out new file mode 100644 index 00000000000..fc6ed94363d --- /dev/null +++ b/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.out @@ -0,0 +1,7 @@ +zzz +42 +OK +first 2 +second 3 +unfrozen OK +frozen OK diff --git a/kotlin-native/backend.native/tests/serialization/serialize_members.kt b/kotlin-native/backend.native/tests/serialization/deserialized_members/library.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/serialize_members.kt rename to kotlin-native/backend.native/tests/serialization/deserialized_members/library.kt diff --git a/kotlin-native/backend.native/tests/serialization/deserialize_members.kt b/kotlin-native/backend.native/tests/serialization/deserialized_members/main.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/deserialize_members.kt rename to kotlin-native/backend.native/tests/serialization/deserialized_members/main.kt diff --git a/kotlin-native/backend.native/tests/serialization/deserialized_members/main.out b/kotlin-native/backend.native/tests/serialization/deserialized_members/main.out new file mode 100644 index 00000000000..d026cd77063 --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/deserialized_members/main.out @@ -0,0 +1,9 @@ +first level +second level +third levelxz +inner first level +inner second level +inner third level +types first level: 13 +types second level cha-cha-cha +types third level 1.0 diff --git a/kotlin-native/backend.native/tests/serialization/enum_ordinal/main.out b/kotlin-native/backend.native/tests/serialization/enum_ordinal/main.out new file mode 100644 index 00000000000..cbeb5c9cc5d --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/enum_ordinal/main.out @@ -0,0 +1,4 @@ +0 +1 +2 +b diff --git a/kotlin-native/backend.native/tests/serialization/regression/no_type_map.out b/kotlin-native/backend.native/tests/serialization/regression/no_type_map.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/regression/no_type_map.out @@ -0,0 +1 @@ +OK diff --git a/kotlin-native/backend.native/tests/serialization/catch.kt b/kotlin-native/backend.native/tests/serialization/serialized_catch/library.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/catch.kt rename to kotlin-native/backend.native/tests/serialization/serialized_catch/library.kt diff --git a/kotlin-native/backend.native/tests/serialization/use.kt b/kotlin-native/backend.native/tests/serialization/serialized_catch/main.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/use.kt rename to kotlin-native/backend.native/tests/serialization/serialized_catch/main.kt diff --git a/kotlin-native/backend.native/tests/serialization/serialized_catch/main.out b/kotlin-native/backend.native/tests/serialization/serialized_catch/main.out new file mode 100644 index 00000000000..8ec4a09f706 --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/serialized_catch/main.out @@ -0,0 +1,2 @@ +Gotcha1: XXX +Gotcha2: YYY diff --git a/kotlin-native/backend.native/tests/serialization/char_const.kt b/kotlin-native/backend.native/tests/serialization/serialized_char_constant/library.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/char_const.kt rename to kotlin-native/backend.native/tests/serialization/serialized_char_constant/library.kt diff --git a/kotlin-native/backend.native/tests/serialization/use_char_const.kt b/kotlin-native/backend.native/tests/serialization/serialized_char_constant/main.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/use_char_const.kt rename to kotlin-native/backend.native/tests/serialization/serialized_char_constant/main.kt diff --git a/kotlin-native/backend.native/tests/serialization/serialized_char_constant/main.out b/kotlin-native/backend.native/tests/serialization/serialized_char_constant/main.out new file mode 100644 index 00000000000..9fcf5282792 --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/serialized_char_constant/main.out @@ -0,0 +1 @@ +Ы diff --git a/kotlin-native/backend.native/tests/serialization/default_args.kt b/kotlin-native/backend.native/tests/serialization/serialized_default_args/library.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/default_args.kt rename to kotlin-native/backend.native/tests/serialization/serialized_default_args/library.kt diff --git a/kotlin-native/backend.native/tests/serialization/prop.kt b/kotlin-native/backend.native/tests/serialization/serialized_default_args/main.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/prop.kt rename to kotlin-native/backend.native/tests/serialization/serialized_default_args/main.kt diff --git a/kotlin-native/backend.native/tests/serialization/serialized_default_args/main.out b/kotlin-native/backend.native/tests/serialization/serialized_default_args/main.out new file mode 100644 index 00000000000..60010628fe2 --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/serialized_default_args/main.out @@ -0,0 +1 @@ +SomeDataClass(first=17, second=666, third=23) diff --git a/kotlin-native/backend.native/tests/serialization/do_while.kt b/kotlin-native/backend.native/tests/serialization/serialized_doWhile/library.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/do_while.kt rename to kotlin-native/backend.native/tests/serialization/serialized_doWhile/library.kt diff --git a/kotlin-native/backend.native/tests/serialization/serialized_doWhile/main.kt b/kotlin-native/backend.native/tests/serialization/serialized_doWhile/main.kt new file mode 100644 index 00000000000..8a0446a79af --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/serialized_doWhile/main.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + + +fun main(args: Array) { + foo() +} diff --git a/kotlin-native/backend.native/tests/serialization/serialized_doWhile/main.out b/kotlin-native/backend.native/tests/serialization/serialized_doWhile/main.out new file mode 100644 index 00000000000..a6905f8ba44 --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/serialized_doWhile/main.out @@ -0,0 +1 @@ +999 diff --git a/kotlin-native/backend.native/tests/serialization/vararg.kt b/kotlin-native/backend.native/tests/serialization/serialized_vararg/library.kt similarity index 100% rename from kotlin-native/backend.native/tests/serialization/vararg.kt rename to kotlin-native/backend.native/tests/serialization/serialized_vararg/library.kt diff --git a/kotlin-native/backend.native/tests/serialization/serialized_vararg/main.kt b/kotlin-native/backend.native/tests/serialization/serialized_vararg/main.kt new file mode 100644 index 00000000000..8a0446a79af --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/serialized_vararg/main.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + + +fun main(args: Array) { + foo() +} diff --git a/kotlin-native/backend.native/tests/serialization/serialized_vararg/main.out b/kotlin-native/backend.native/tests/serialization/serialized_vararg/main.out new file mode 100644 index 00000000000..b35a8d31583 --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/serialized_vararg/main.out @@ -0,0 +1,6 @@ +17 +19 +23 +29 +31 +size: 5 diff --git a/kotlin-native/backend.native/tests/testing/annotations.out b/kotlin-native/backend.native/tests/testing/annotations.out new file mode 100644 index 00000000000..8a7d24bfa62 --- /dev/null +++ b/kotlin-native/backend.native/tests/testing/annotations.out @@ -0,0 +1,47 @@ +Starting testing +Starting iteration: 1 +Test suite ignored: kotlin.test.tests.IgnoredClass.IgnoredObject +Test suite ignored: kotlin.test.tests.IgnoredClass +Test suite ignored: kotlin.test.tests.IgnoredObject +Starting test suite: kotlin.test.tests.A +beforeClass (A.companion) +Starting test case: test1 (kotlin.test.tests.A) +before (A) +test1 (A) +after (A) +Passed: test1 (kotlin.test.tests.A) +Ignore: ignoredTest (kotlin.test.tests.A) +afterClass (A.companion) +Test suite finished: kotlin.test.tests.A +Starting test suite: kotlin.test.tests.A.O +beforeClass (A.object) +Starting test case: test1 (kotlin.test.tests.A.O) +before (A.object) +test1 (A.object) +after (A.object) +Passed: test1 (kotlin.test.tests.A.O) +Ignore: ignoredTest (kotlin.test.tests.A.O) +afterClass (A.object) +Test suite finished: kotlin.test.tests.A.O +Starting test suite: kotlin.test.tests.O +beforeClass (object) +Starting test case: test1 (kotlin.test.tests.O) +before (object) +test1 (object) +after (object) +Passed: test1 (kotlin.test.tests.O) +Ignore: ignoredTest (kotlin.test.tests.O) +afterClass (object) +Test suite finished: kotlin.test.tests.O +Starting test suite: kotlin.test.tests.AnnotationsKt +beforeClass (file) +Starting test case: test1 (kotlin.test.tests.AnnotationsKt) +before (file) +test1 (file) +after (file) +Passed: test1 (kotlin.test.tests.AnnotationsKt) +Ignore: ignoredTest (kotlin.test.tests.AnnotationsKt) +afterClass (file) +Test suite finished: kotlin.test.tests.AnnotationsKt +Iteration finished: 1 +Testing finished diff --git a/kotlin-native/backend.native/tests/testing/custom_main.out b/kotlin-native/backend.native/tests/testing/custom_main.out new file mode 100644 index 00000000000..3f6f7862e66 --- /dev/null +++ b/kotlin-native/backend.native/tests/testing/custom_main.out @@ -0,0 +1,17 @@ +Custom main +Starting testing +Starting iteration: 1 +Starting test suite: kotlin.test.tests.Custom_mainKt +Starting test case: test (kotlin.test.tests.Custom_mainKt) +test +Passed: test (kotlin.test.tests.Custom_mainKt) +Test suite finished: kotlin.test.tests.Custom_mainKt +Iteration finished: 1 +Starting iteration: 2 +Starting test suite: kotlin.test.tests.Custom_mainKt +Starting test case: test (kotlin.test.tests.Custom_mainKt) +test +Passed: test (kotlin.test.tests.Custom_mainKt) +Test suite finished: kotlin.test.tests.Custom_mainKt +Iteration finished: 2 +Testing finished diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/KotlinNativeTest.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/KotlinNativeTest.kt index f22aab1d65a..2a9daa18152 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/KotlinNativeTest.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/KotlinNativeTest.kt @@ -10,9 +10,7 @@ import org.gradle.api.DefaultTask import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.provider.Provider -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.Optional -import org.gradle.api.tasks.TaskAction +import org.gradle.api.tasks.* import org.gradle.language.base.plugins.LifecycleBasePlugin import org.gradle.process.ExecSpec import org.jetbrains.kotlin.konan.exec.Command @@ -222,18 +220,34 @@ open class KonanLocalTest : KonanTest() { var expectedFail = false /** - * Used to validate output as a gold value. + * Used to validate output against the golden data. */ @Input @Optional - var goldValue: String? = null + var useGoldenData: Boolean = false + + @get:InputFile + open val goldenDataFile: File + get() { + val sourceFile = project.file(source) + return sourceFile.parentFile.resolve(sourceFile.nameWithoutExtension + ".out") + } + + private val goldenData: String? + get() = if (useGoldenData) { + check(goldenDataFile.isFile) { "Task $name. Golden data file does not exist: $goldenDataFile" } + goldenDataFile.readText(Charsets.UTF_8) + } else + null /** * Checks test's output against gold value and returns true if the output matches the expectation. */ @Input @Optional - var outputChecker: (String) -> Boolean = { str -> goldValue == null || goldValue == str } + var outputChecker: (String) -> Boolean = { output -> + if (useGoldenData) goldenData == output else true + } /** * Input test data to be passed to process' stdin. @@ -307,23 +321,21 @@ open class KonanLocalTest : KonanTest() { println("Expected failure. $message") } - val result = stdOut + stdErr - val goldValueMismatch = !outputChecker(result.replace(System.lineSeparator(), "\n")) - if (goldValueMismatch) { - val message = if (goldValue != null) - "Expected output: $goldValue, actual output: $result" - else - "Actual output doesn't match with output checker: $result" + val output = stdOut + stdErr + val outputMismatch = !outputChecker(output.replace(System.lineSeparator(), "\n")) + if (outputMismatch) { + val message = goldenData?.let { goldenData -> "Expected output: $goldenData, actual output: $output" } + ?: "Actual output doesn't match with output checker: $output" check(expectedFail) { "Test failed. $message" } println("Expected failure. $message") } - check((exitCodeMismatch || goldValueMismatch) || !expectedFail) { + check((exitCodeMismatch || outputMismatch) || !expectedFail) { """ |Unexpected pass: | * exit code mismatch: $exitCodeMismatch - | * gold value mismatch: $goldValueMismatch + | * gold value mismatch: $outputMismatch | * expected fail: $expectedFail """.trimMargin() } @@ -463,6 +475,13 @@ open class KonanDynamicTest : KonanStandaloneTest() { @Optional var interop: String? = null + override val goldenDataFile: File + get() { + val sourceFile = project.file(source) + val cSourceFile = File(cSource) + return sourceFile.parentFile.resolve(sourceFile.nameWithoutExtension + "-" + cSourceFile.nameWithoutExtension + ".out") + } + // Replace testlib_api.h and all occurrences of the testlib with the actual name of the test private fun processCSource(): String { val sourceFile = File(cSource)