diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index 5a5afab552d..0842e66f534 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -398,6 +398,11 @@ task throw0(type: RunKonanTest) { source = "runtime/basic/throw0.kt" } +task statements0(type: RunKonanTest) { + goldValue = "239\n238\n30\n29\n" + source = "runtime/basic/statements0.kt" +} + /* task boxing0(type: RunKonanTest) { goldValue = "17\n" diff --git a/backend.native/tests/runtime/basic/statements0.kt b/backend.native/tests/runtime/basic/statements0.kt new file mode 100644 index 00000000000..1e403787be1 --- /dev/null +++ b/backend.native/tests/runtime/basic/statements0.kt @@ -0,0 +1,32 @@ +fun simple() { + var a = 238 + a++ + println(a) + --a + println(a) +} + +class Foo() { + var i = 29 + + fun more() { + i++ + } + + fun less() { + --i + } +} + +fun fields() { + val foo = Foo() + foo.more() + println(foo.i) + foo.less() + println(foo.i) +} + +fun main(args: Array) { + simple() + fields() +} \ No newline at end of file