JVM_IR KT-47984 add test for argument reordering

This commit is contained in:
Dmitry Petrov
2021-08-10 15:02:35 +03:00
committed by TeamCityServer
parent edd2ca775b
commit 15c41b2610
12 changed files with 199 additions and 0 deletions
@@ -2311,6 +2311,22 @@ public class FirBlackBoxInlineCodegenTestGenerated extends AbstractFirBlackBoxIn
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
public class InlineArgsInplace {
@Test
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -0,0 +1,17 @@
// WITH_RUNTIME
// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt
var s = ""
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
inline fun foo(s1: String, s2: String) = s1 + s2
// FILE: 2.kt
fun box(): String {
val t = foo(s2 = { s += "O"; "K" }(), s1 = { s += "K"; "O" }())
if (t != "OK") return "Failed: t=$t"
if (s != "OK") return "Failed: s=$s"
return "OK"
}
@@ -2299,6 +2299,22 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
public class InlineArgsInplace {
@Test
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -2299,6 +2299,22 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
public class InlineArgsInplace {
@Test
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -2311,6 +2311,22 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
public class InlineArgsInplace {
@Test
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -2311,6 +2311,22 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
public class InlineArgsInplace {
@Test
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -2311,6 +2311,22 @@ public class IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated extends Ab
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
public class InlineArgsInplace {
@Test
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -2311,6 +2311,22 @@ public class JvmIrAgainstOldBoxInlineTestGenerated extends AbstractJvmIrAgainstO
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
public class InlineArgsInplace {
@Test
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_IR_AGAINST_OLD, true);
}
@Test
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -2299,6 +2299,22 @@ public class JvmOldAgainstIrBoxInlineTestGenerated extends AbstractJvmOldAgainst
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
public class InlineArgsInplace {
@Test
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_OLD_AGAINST_IR, true);
}
@Test
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -1826,6 +1826,24 @@ public class IrJsCodegenInlineES6TestGenerated extends AbstractIrJsCodegenInline
}
}
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlineArgsInplace extends AbstractIrJsCodegenInlineES6Test {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
}
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -1826,6 +1826,24 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes
}
}
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlineArgsInplace extends AbstractIrJsCodegenInlineTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -1826,6 +1826,24 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest {
}
}
@TestMetadata("compiler/testData/codegen/boxInline/inlineArgsInplace")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlineArgsInplace extends AbstractJsCodegenInlineTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInInlineArgsInplace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/inlineArgsInplace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@TestMetadata("callArgumentReordering.kt")
public void testCallArgumentReordering() throws Exception {
runTest("compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt");
}
}
@TestMetadata("compiler/testData/codegen/boxInline/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)