[Tests] Migrate backend-independent tests from native to compiler/testData.
^KT-65979
This commit is contained in:
committed by
Space Team
parent
dd9332d9e1
commit
febac0dd5f
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// TODO: check mentioned debug output of escape analyser
|
||||
|
||||
// Note: intentional infinite recursion for F(String). Don't try to execute the code.
|
||||
class F(val s: String) {
|
||||
var g = F("OK")
|
||||
}
|
||||
|
||||
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 box(): String {
|
||||
// When uncommented, execution of the following line would fall into infinite recursion
|
||||
// foo(A()).s
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user