[box-tests] Added test
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
// IGNORE_BACKEND: JVM
|
||||||
|
// IGNORE_BACKEND_MULTI_MODULE: JVM, JVM_IR
|
||||||
|
|
||||||
|
// FILE: 1.kt
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
fun compute(): Int
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun foo(x: Int, block: (Int) -> Foo) = block(x)
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun bar(): Int {
|
||||||
|
return foo(21) { x ->
|
||||||
|
val o = object : Foo {
|
||||||
|
override fun compute(): Int {
|
||||||
|
return call { x * 2 }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun call(f: () -> Int) = f()
|
||||||
|
}
|
||||||
|
o
|
||||||
|
}.compute()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() = if (bar() == 42) "OK" else "fail"
|
||||||
+5
@@ -121,6 +121,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
|||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionExpression.kt")
|
||||||
|
public void testFunctionExpression() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/functionExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
||||||
public void testInlineCallInsideInlineLambda() throws Exception {
|
public void testInlineCallInsideInlineLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
||||||
|
|||||||
Generated
+5
@@ -121,6 +121,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
|||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionExpression.kt")
|
||||||
|
public void testFunctionExpression() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/functionExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
||||||
public void testInlineCallInsideInlineLambda() throws Exception {
|
public void testInlineCallInsideInlineLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
||||||
|
|||||||
+5
@@ -121,6 +121,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
|||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionExpression.kt")
|
||||||
|
public void testFunctionExpression() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/functionExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
||||||
public void testInlineCallInsideInlineLambda() throws Exception {
|
public void testInlineCallInsideInlineLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
||||||
|
|||||||
Generated
+5
@@ -121,6 +121,11 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
|
|||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionExpression.kt")
|
||||||
|
public void testFunctionExpression() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/functionExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
||||||
public void testInlineCallInsideInlineLambda() throws Exception {
|
public void testInlineCallInsideInlineLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
||||||
|
|||||||
Generated
+5
@@ -121,6 +121,11 @@ public class IrJsCodegenInlineES6TestGenerated extends AbstractIrJsCodegenInline
|
|||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionExpression.kt")
|
||||||
|
public void testFunctionExpression() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/functionExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
||||||
public void testInlineCallInsideInlineLambda() throws Exception {
|
public void testInlineCallInsideInlineLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
||||||
|
|||||||
Generated
+5
@@ -121,6 +121,11 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes
|
|||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionExpression.kt")
|
||||||
|
public void testFunctionExpression() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/functionExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
||||||
public void testInlineCallInsideInlineLambda() throws Exception {
|
public void testInlineCallInsideInlineLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
||||||
|
|||||||
+5
@@ -121,6 +121,11 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest {
|
|||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionExpression.kt")
|
||||||
|
public void testFunctionExpression() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/functionExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
@TestMetadata("inlineCallInsideInlineLambda.kt")
|
||||||
public void testInlineCallInsideInlineLambda() throws Exception {
|
public void testInlineCallInsideInlineLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user