[box-tests] Added test

This commit is contained in:
Igor Chevdar
2020-07-15 18:41:18 +05:00
parent 8bbbee8ffd
commit 3c4f0d3c9e
8 changed files with 66 additions and 0 deletions
@@ -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"
@@ -121,6 +121,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
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")
public void testInlineCallInsideInlineLambda() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
@@ -121,6 +121,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
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")
public void testInlineCallInsideInlineLambda() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
@@ -121,6 +121,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
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")
public void testInlineCallInsideInlineLambda() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
@@ -121,6 +121,11 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
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")
public void testInlineCallInsideInlineLambda() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
@@ -121,6 +121,11 @@ public class IrJsCodegenInlineES6TestGenerated extends AbstractIrJsCodegenInline
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")
public void testInlineCallInsideInlineLambda() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
@@ -121,6 +121,11 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes
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")
public void testInlineCallInsideInlineLambda() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");
@@ -121,6 +121,11 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest {
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")
public void testInlineCallInsideInlineLambda() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt");