Move everything under kotlin-native folder

I was forced to manually do update the following files, because otherwise
they would be ignored according .gitignore settings. Probably they
should be deleted from repo.

Interop/.idea/compiler.xml
Interop/.idea/gradle.xml
Interop/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_3.xml
Interop/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_3.xml
Interop/.idea/modules.xml
Interop/.idea/modules/Indexer/Indexer.iml
Interop/.idea/modules/Runtime/Runtime.iml
Interop/.idea/modules/StubGenerator/StubGenerator.iml
backend.native/backend.native.iml
backend.native/bc.frontend/bc.frontend.iml
backend.native/cli.bc/cli.bc.iml
backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt
backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt
backend.native/tests/link/lib/foo.kt
backend.native/tests/link/lib/foo2.kt
backend.native/tests/teamcity-test.property
This commit is contained in:
Stanislav Erokhin
2020-10-27 21:00:28 +03:00
parent 91e4162dad
commit f624800b84
2830 changed files with 0 additions and 0 deletions
@@ -0,0 +1,24 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.recursion
import kotlin.test.*
class A {
var f: A? = null
}
fun foo(k: Int, a1: A, a2: A): A {
val a3 = A()
if (k == 0)
return a1
a3.f = a1
return foo(k - 1, a2, a3)
}
@Test fun runTest() {
foo(3, A(), A()).toString()
}
@@ -0,0 +1,20 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test1
class A(val s: String)
// ----- Agressive -----
// PointsTo:
// RET.v@lue -> P0
// Escapes:
// ----- Passive -----
// PointsTo:
// RET.v@lue -> P0
// Escapes:
fun foo(a: A) = a
fun main() = println(foo(A("zzz")))
@@ -0,0 +1,41 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test10
class G(val x: Int)
class F(val s: String) {
var g = G(0)
}
class A {
var f = F("")
}
// ----- Agressive -----
// PointsTo:
// P0.f -> D0
// RET.v@lue -> D0
// Escapes:
// ----- Passive -----
// PointsTo:
// P0.f -> D0
// RET.v@lue -> D0
// Escapes: D0
fun foo(a: A): F {
val v = F("zzz")
a.f = v
return v
}
fun bar(): F {
val w = A()
val u = foo(w)
w.f.g = G(42)
return u
}
fun main() = println(bar().g.x)
@@ -0,0 +1,31 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test11
class F(val x: Int)
class A(val s: String) {
var f = F(0)
}
var f: F? = null
// ----- Agressive -----
// PointsTo:
// RET.v@lue -> P0.f
// D0 -> P0.f
// Escapes: D0
// ----- Passive -----
// PointsTo:
// RET.v@lue -> P0.f
// D0 -> P0.f
// Escapes: D0
fun foo(a: A): F {
f = a.f
return a.f
}
fun main() = println(foo(A("zzz")))
@@ -0,0 +1,20 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test12
class A(val s: String)
// ----- Agressive -----
// PointsTo:
// RET.v@lue -> P0.inte$tines
// Escapes:
// ----- Passive -----
// PointsTo:
// RET.v@lue -> P0.inte$tines
// Escapes:
fun foo(arr: Array<A>) = arr[0]
fun main() = println(foo(arrayOf(A("zzz"))).s)
@@ -0,0 +1,20 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test13
class A {
var f: A? = null
}
fun foo(a: A, k: Int): A {
return if (k == 0) a else foo(a.f!!, k - 1)
}
fun main() {
val a = A()
a.f = A()
println(foo(a, 1))
}
@@ -0,0 +1,20 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test2
class A(val s: String)
// ----- Agressive -----
// PointsTo:
// RET.v@lue -> P0.s
// Escapes:
// ----- Passive -----
// PointsTo:
// RET.v@lue -> P0.s
// Escapes:
fun foo(a: A) = a.s
fun main() = println(foo(A("zzz")))
@@ -0,0 +1,28 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test3
class A(val s: String)
class B {
var s: String? = null
}
// ----- Agressive -----
// PointsTo:
// P1.s -> P0.s
// RET.v@lue -> P0.s
// Escapes:
// ----- Passive -----
// PointsTo:
// P1.s -> P0.s
// RET.v@lue -> P0.s
// Escapes:
fun foo(a: A, b: B): String {
b.s = a.s
return a.s
}
fun main() = println(foo(A("zzz"), B()))
@@ -0,0 +1,30 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test4
class A(val s: String)
class B {
var f: A = A("qzz")
}
class C {
var g: B = B()
}
// ----- Agressive -----
// PointsTo:
// P0.g.f -> P1.g.f
// RET.v@lue -> D0
// Escapes: D0
// ----- Passive -----
// PointsTo:
// P0.g.f -> P1.g.f
// RET.v@lue -> D0
// Escapes: D0
fun foo(c1: C, c2: C) {
c1.g.f = c2.g.f
}
fun main() = println(foo(C(), C()))
@@ -0,0 +1,35 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test5
class A(val s: String)
class B {
var f: A = A("qzz")
}
class C {
var g: B = B()
}
// ----- Agressive -----
// PointsTo:
// RET.v@lue -> D0
// D0.f -> P0.g.f
// Escapes:
// ----- Passive -----
// PointsTo:
// P0.g.f -> D2
// RET.v@lue -> D0
// D0.f -> P0.g.f
// D0.f -> D1
// D1 -> D2
// Escapes: D0 D1
fun foo(c1: C, c2: C): B {
val b = B()
b.f = c1.g.f
return b
}
fun main() = println(foo(C(), C()))
@@ -0,0 +1,40 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test6
class A(val s: String)
class B {
var f: A = A("qzz")
}
class C {
var g: B = B()
}
// ----- Agressive -----
// PointsTo:
// P1.g -> D0
// P2.g -> D0
// RET.v@lue -> P1.g
// RET.v@lue -> P2.g
// RET.v@lue -> D0
// D0.f -> P3
// Escapes:
// ----- Passive -----
// PointsTo:
// P1.g -> D0
// P2.g -> D0
// RET.v@lue -> P1.g
// RET.v@lue -> P2.g
// RET.v@lue -> D0
// D0.f -> P3
// Escapes:
fun foo(z: Boolean, c1: C, c2: C, a: A): B {
val v = if(z) c1.g else c2.g
v.f = a
return v
}
fun main() = println(foo(true, C(), C(), A("zzz")))
@@ -0,0 +1,52 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test7
class A(val s: String) {
var h: String = ""
var p: C = C()
}
class B {
var f: A = A("qzz")
}
class C {
var g: A = A("")
}
class D {
var o: A = A("")
}
// ----- Agressive -----
// PointsTo:
// P1.g -> D0
// P2.f -> D0
// P4.o -> P1.g
// P4.o -> P2.f
// P4.o -> D0
// RET.v@lue -> D1
// D0.p -> P1
// D0.h -> P3
// Escapes: D1
// ----- Passive -----
// PointsTo:
// P1.g -> D0
// P2.f -> D0
// P4.o -> P1.g
// P4.o -> P2.f
// P4.o -> D0
// RET.v@lue -> D1
// D0.p -> P1
// D0.h -> P3
// Escapes: D1
fun foo(z: Boolean, c: C, b: B, s: String, d: D) {
val v = if(z) c.g else b.f
v.h = s
d.o = v
val u = v
u.p = c
}
fun main() = println(foo(true, C(), B(), "zzz", D()))
@@ -0,0 +1,43 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test8
class F(val s: String) {
var g = F("")
}
class A {
var f = F("qzz")
}
// ----- Agressive -----
// PointsTo:
// P0.f -> D0
// RET.v@lue -> P0.f
// RET.v@lue -> D0
// RET.v@lue -> D0.g
// D0.g -> P0.f
// D0.g -> D0
// Escapes:
// ----- Passive -----
// PointsTo:
// P0.f -> D0
// RET.v@lue -> P0.f
// RET.v@lue -> D0
// RET.v@lue -> D0.g
// D0.g -> P0.f
// D0.g -> D0
// D0.g -> D2
// D1 -> D0
// D2 -> D0
// Escapes: D1 D2
fun foo(a: A): F {
a.f = F("zzz")
a.f.g = a.f
return a.f.g.g
}
fun main() = println(foo(A()).s)
@@ -0,0 +1,36 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.test9
class H(val x: Int)
class F(val s: String) {
var g = F("")
var h = H(0)
}
class A {
var f = F("qzz")
}
// ----- Agressive -----
// PointsTo:
// P0.f -> P1.g
// RET.v@lue -> P1.g.h
// Escapes:
// ----- Passive -----
// PointsTo:
// P0.f -> P1.g
// P1.g.h -> D0
// RET.v@lue -> P1.g.h
// Escapes: D0
fun foo(a: A, f: F): H {
a.f = f.g
a.f.h = H(42)
return f.g.h
}
fun main() = println(foo(A(), F("zzz")).x)
@@ -0,0 +1,25 @@
/*
* Copyright 2010-2020 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 codegen.escapeAnalysis.zeroOutObjectOnAlloc
import kotlin.test.*
class A {
var x = 0
}
@Test fun runTest() {
var sum1 = 0
var sum2 = 0
for (i in 0 until 10) {
val a = A()
sum1 += a.x
a.x = i
sum2 += a.x
}
assertEquals(0, sum1)
assertEquals(45, sum2)
}