IR attributes full copy - failing tests
diff --git a/compiler/testData/codegen/boxInline/simple/kt17431.kt b/compiler/testData/codegen/boxInline/simple/kt17431.kt
index 4f56c73..d5f22a2 100644
--- a/compiler/testData/codegen/boxInline/simple/kt17431.kt
+++ b/compiler/testData/codegen/boxInline/simple/kt17431.kt
@@ -4,35 +4,14 @@
// FILE: 1.kt
package test
-class WeakReference<T>(val value: T)
-
-inline fun <K, V> MutableMap<K, WeakReference<V>>.getOrPutWeak(key: K, defaultValue: ()->V): V {
- val value = get(key)?.value
- return if (value == null) {
- val answer = defaultValue()
- put(key, WeakReference(answer))
- answer
- } else {
- value
- }
+inline fun getOrPutWeak(defaultValue: ()->String): String {
+ val answer = defaultValue()
+ return answer
}
-
// FILE: 2.kt
import test.*
-class LabelHolder {
-
- fun test(): String {
- return "hello".label
- }
-
- private val labels = hashMapOf<String?, WeakReference<String>>()
-
- private val String?.label: String
- get(): String = labels.getOrPutWeak(this) { "OK" }
-}
-
fun box(): String {
- return LabelHolder().test()
+ return getOrPutWeak { "OK" }
}
diff --git a/compiler/testData/codegen/boxInline/special/unusedInlineLambda.kt b/compiler/testData/codegen/boxInline/special/unusedInlineLambda.kt
index edbcf28..91a5280 100644
--- a/compiler/testData/codegen/boxInline/special/unusedInlineLambda.kt
+++ b/compiler/testData/codegen/boxInline/special/unusedInlineLambda.kt
@@ -1,13 +1,23 @@
// FILE: 1.kt
package test
-inline fun f(g: () -> Int) {}
-inline fun h(g: () -> Int) = run { f(g) }
+/*inline fun <R> rruunn(block: () -> R): R {
+ contract {
+ callsInPlace(block, kotlin.contracts.InvocationKind.EXACTLY_ONCE)
+ }
+ return block()
+}*/
+
+inline fun h(): Int {
+ return run {
+ 1
+ }
+}
// FILE: 2.kt
import test.*
fun box(): String {
- h { 1 }
+ h()
return "OK"
}