JVM_IR KT-45697 reference classes from sources before IR generation

This commit is contained in:
Dmitry Petrov
2021-03-30 17:46:21 +03:00
committed by TeamCityServer
parent 7d211d0d9a
commit 9bf7f3af04
20 changed files with 737 additions and 2 deletions
@@ -38001,6 +38001,70 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/sameFileInSourceAndDependencies")
@TestDataPath("$PROJECT_ROOT")
public class SameFileInSourceAndDependencies {
@Test
public void testAllFilesPresentInSameFileInSourceAndDependencies() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sameFileInSourceAndDependencies"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("classDeclaration.kt")
public void testClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/classDeclaration.kt");
}
@Test
@TestMetadata("functionDeclaration.kt")
public void testFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/functionDeclaration.kt");
}
@Test
@TestMetadata("jvmFieldMemberPropertyDeclaration.kt")
public void testJvmFieldMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/jvmFieldMemberPropertyDeclaration.kt");
}
@Test
@TestMetadata("lateinitMemberPropertyDeclaration.kt")
public void testLateinitMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/lateinitMemberPropertyDeclaration.kt");
}
@Test
@TestMetadata("memberFunctionDeclaration.kt")
public void testMemberFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionDeclaration.kt");
}
@Test
@TestMetadata("memberFunctionWithDefaultArgumentsDeclaration.kt")
public void testMemberFunctionWithDefaultArgumentsDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionWithDefaultArgumentsDeclaration.kt");
}
@Test
@TestMetadata("memberPropertyDeclaration.kt")
public void testMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberPropertyDeclaration.kt");
}
@Test
@TestMetadata("nestedClassDeclaration.kt")
public void testNestedClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/nestedClassDeclaration.kt");
}
@Test
@TestMetadata("propertyDeclaration.kt")
public void testPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/propertyDeclaration.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/sealed")
@TestDataPath("$PROJECT_ROOT")
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.psi2ir.Psi2IrConfiguration
import org.jetbrains.kotlin.psi2ir.Psi2IrTranslator
import org.jetbrains.kotlin.psi2ir.generators.DeclarationStubGeneratorImpl
import org.jetbrains.kotlin.psi2ir.generators.generateTypicalIrProviderList
import org.jetbrains.kotlin.psi2ir.preprocessing.SourceDeclarationsPreprocessor
import org.jetbrains.kotlin.resolve.CleanableBindingContext
open class JvmIrCodegenFactory(
@@ -115,6 +116,8 @@ open class JvmIrCodegenFactory(
}
}
SourceDeclarationsPreprocessor(psi2irContext).run(files)
for (extension in pluginExtensions) {
psi2ir.addPostprocessingStep { module ->
val old = stubGenerator.unboundSymbolGeneration
@@ -25,7 +25,6 @@ import org.jetbrains.kotlin.ir.linkage.IrDeserializer
import org.jetbrains.kotlin.ir.linkage.IrProvider
import org.jetbrains.kotlin.ir.symbols.IrSymbol
import org.jetbrains.kotlin.ir.util.SymbolTable
import org.jetbrains.kotlin.ir.util.TypeTranslator
import org.jetbrains.kotlin.ir.util.noUnboundLeft
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi2ir.generators.GeneratorContext
@@ -35,7 +34,9 @@ import org.jetbrains.kotlin.psi2ir.generators.TypeTranslatorImpl
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.utils.SmartList
typealias Psi2IrPostprocessingStep = (IrModuleFragment) -> Unit
fun interface Psi2IrPostprocessingStep {
fun invoke(irModuleFragment: IrModuleFragment)
}
class Psi2IrTranslator(
val languageVersionSettings: LanguageVersionSettings,
@@ -0,0 +1,40 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi2ir.preprocessing
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtDeclaration
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.synthetics.findClassDescriptor
import org.jetbrains.kotlin.psi2ir.generators.GeneratorContext
import org.jetbrains.kotlin.resolve.DescriptorUtils
class SourceDeclarationsPreprocessor(private val context: GeneratorContext) {
fun run(ktFiles: Collection<KtFile>) {
for (ktFile in ktFiles.toSet()) {
for (ktDeclaration in ktFile.declarations) {
processDeclaration(ktDeclaration)
}
}
}
private fun processDeclaration(ktDeclaration: KtDeclaration) {
when (ktDeclaration) {
is KtClassOrObject ->
processClassOrObject(ktDeclaration)
}
}
private fun processClassOrObject(ktClassOrObject: KtClassOrObject) {
val classDescriptor = ktClassOrObject.findClassDescriptor(context.bindingContext)
if (DescriptorUtils.isEnumEntry(classDescriptor)) return
context.symbolTable.referenceClass(classDescriptor)
ktClassOrObject.body?.let { ktClassBody ->
ktClassBody.declarations.forEach { processDeclaration(it) }
}
}
}
@@ -0,0 +1,25 @@
// MODULE: lib
// FILE: 2.kt
abstract class A {
private val value = "OK"
fun f() = value
}
abstract class B : A()
// FILE: 3.kt
abstract class C : B()
// MODULE: main(lib)
// FILE: 1.kt
class D : C()
fun box(): String = D().f()
// FILE: 2.kt
abstract class A {
private val value = "OK"
fun f() = value
}
abstract class B : A()
@@ -0,0 +1,17 @@
// MODULE: lib
// FILE: 2.kt
fun a() = "OK"
fun b() = a()
// FILE: 3.kt
fun c() = b()
// MODULE: main(lib)
// FILE: 1.kt
fun d() = c()
fun box(): String = d()
// FILE: 2.kt
fun a() = "OK"
fun b() = a()
@@ -0,0 +1,27 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// MODULE: lib
// FILE: 2.kt
abstract class A {
@JvmField val value: String = "OK"
fun f() = value
}
abstract class B : A()
// FILE: 3.kt
abstract class C : B()
// MODULE: main(lib)
// FILE: 1.kt
class D : C()
fun box(): String = D().f()
// FILE: 2.kt
abstract class A {
@JvmField val value: String = "OK"
fun f() = value
}
abstract class B : A()
@@ -0,0 +1,33 @@
// MODULE: lib
// FILE: 2.kt
abstract class A {
protected lateinit var value: String
fun f() = value
}
abstract class B : A() {
init {
value = "OK"
}
}
// FILE: 3.kt
abstract class C : B()
// MODULE: main(lib)
// FILE: 1.kt
class D : C()
fun box(): String = D().f()
// FILE: 2.kt
abstract class A {
protected lateinit var value: String
fun f() = value
}
abstract class B : A() {
init {
value = "OK"
}
}
@@ -0,0 +1,27 @@
// MODULE: lib
// FILE: 2.kt
abstract class A {
protected val value = "OK"
}
abstract class B : A() {
fun f() = value
}
// FILE: 3.kt
abstract class C : B()
// MODULE: main(lib)
// FILE: 1.kt
class D : C()
fun box(): String = D().f()
// FILE: 2.kt
abstract class A {
protected val value = "OK"
}
abstract class B : A() {
fun f() = value
}
@@ -0,0 +1,25 @@
// MODULE: lib
// FILE: 2.kt
abstract class A {
protected val value = "O"
fun f(k: String = "K") = value + k
}
abstract class B : A()
// FILE: 3.kt
abstract class C : B()
// MODULE: main(lib)
// FILE: 1.kt
class D : C()
fun box(): String = D().f()
// FILE: 2.kt
abstract class A {
protected val value = "O"
fun f(k: String = "K") = value + k
}
abstract class B : A()
@@ -0,0 +1,27 @@
// MODULE: lib
// FILE: 2.kt
abstract class A {
protected val value = "OK"
}
abstract class B : A() {
val ok get() = value
}
// FILE: 3.kt
abstract class C : B()
// MODULE: main(lib)
// FILE: 1.kt
class D : C()
fun box(): String = D().ok
// FILE: 2.kt
abstract class A {
protected val value = "OK"
}
abstract class B : A() {
val ok get() = value
}
@@ -0,0 +1,30 @@
// IGNORE_BACKEND: JS_IR
// MODULE: lib
// FILE: 2.kt
class Host {
abstract class B : A()
abstract class A {
private val value = "OK"
fun f() = value
}
}
// FILE: 3.kt
abstract class C : Host.B()
// MODULE: main(lib)
// FILE: 1.kt
class D : C()
fun box(): String = D().f()
// FILE: 2.kt
class Host {
abstract class B : A()
abstract class A {
private val value = "OK"
fun f() = value
}
}
@@ -0,0 +1,18 @@
// IGNORE_BACKEND: JS_IR
// MODULE: lib
// FILE: 2.kt
val a get() = "OK"
val b get() = a
// FILE: 3.kt
val c get() = b
// MODULE: main(lib)
// FILE: 1.kt
val d get() = c
fun box(): String = d
// FILE: 2.kt
val a get() = "OK"
val b get() = a
@@ -37983,6 +37983,70 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/sameFileInSourceAndDependencies")
@TestDataPath("$PROJECT_ROOT")
public class SameFileInSourceAndDependencies {
@Test
public void testAllFilesPresentInSameFileInSourceAndDependencies() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sameFileInSourceAndDependencies"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("classDeclaration.kt")
public void testClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/classDeclaration.kt");
}
@Test
@TestMetadata("functionDeclaration.kt")
public void testFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/functionDeclaration.kt");
}
@Test
@TestMetadata("jvmFieldMemberPropertyDeclaration.kt")
public void testJvmFieldMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/jvmFieldMemberPropertyDeclaration.kt");
}
@Test
@TestMetadata("lateinitMemberPropertyDeclaration.kt")
public void testLateinitMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/lateinitMemberPropertyDeclaration.kt");
}
@Test
@TestMetadata("memberFunctionDeclaration.kt")
public void testMemberFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionDeclaration.kt");
}
@Test
@TestMetadata("memberFunctionWithDefaultArgumentsDeclaration.kt")
public void testMemberFunctionWithDefaultArgumentsDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionWithDefaultArgumentsDeclaration.kt");
}
@Test
@TestMetadata("memberPropertyDeclaration.kt")
public void testMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberPropertyDeclaration.kt");
}
@Test
@TestMetadata("nestedClassDeclaration.kt")
public void testNestedClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/nestedClassDeclaration.kt");
}
@Test
@TestMetadata("propertyDeclaration.kt")
public void testPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/propertyDeclaration.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/sealed")
@TestDataPath("$PROJECT_ROOT")
@@ -38001,6 +38001,70 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/sameFileInSourceAndDependencies")
@TestDataPath("$PROJECT_ROOT")
public class SameFileInSourceAndDependencies {
@Test
public void testAllFilesPresentInSameFileInSourceAndDependencies() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sameFileInSourceAndDependencies"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("classDeclaration.kt")
public void testClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/classDeclaration.kt");
}
@Test
@TestMetadata("functionDeclaration.kt")
public void testFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/functionDeclaration.kt");
}
@Test
@TestMetadata("jvmFieldMemberPropertyDeclaration.kt")
public void testJvmFieldMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/jvmFieldMemberPropertyDeclaration.kt");
}
@Test
@TestMetadata("lateinitMemberPropertyDeclaration.kt")
public void testLateinitMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/lateinitMemberPropertyDeclaration.kt");
}
@Test
@TestMetadata("memberFunctionDeclaration.kt")
public void testMemberFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionDeclaration.kt");
}
@Test
@TestMetadata("memberFunctionWithDefaultArgumentsDeclaration.kt")
public void testMemberFunctionWithDefaultArgumentsDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionWithDefaultArgumentsDeclaration.kt");
}
@Test
@TestMetadata("memberPropertyDeclaration.kt")
public void testMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberPropertyDeclaration.kt");
}
@Test
@TestMetadata("nestedClassDeclaration.kt")
public void testNestedClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/nestedClassDeclaration.kt");
}
@Test
@TestMetadata("propertyDeclaration.kt")
public void testPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/propertyDeclaration.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/sealed")
@TestDataPath("$PROJECT_ROOT")
@@ -30318,6 +30318,64 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
}
}
@TestMetadata("compiler/testData/codegen/box/sameFileInSourceAndDependencies")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SameFileInSourceAndDependencies extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInSameFileInSourceAndDependencies() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sameFileInSourceAndDependencies"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("classDeclaration.kt")
public void testClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/classDeclaration.kt");
}
@TestMetadata("functionDeclaration.kt")
public void testFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/functionDeclaration.kt");
}
@TestMetadata("jvmFieldMemberPropertyDeclaration.kt")
public void testJvmFieldMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/jvmFieldMemberPropertyDeclaration.kt");
}
@TestMetadata("lateinitMemberPropertyDeclaration.kt")
public void testLateinitMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/lateinitMemberPropertyDeclaration.kt");
}
@TestMetadata("memberFunctionDeclaration.kt")
public void testMemberFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionDeclaration.kt");
}
@TestMetadata("memberFunctionWithDefaultArgumentsDeclaration.kt")
public void testMemberFunctionWithDefaultArgumentsDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionWithDefaultArgumentsDeclaration.kt");
}
@TestMetadata("memberPropertyDeclaration.kt")
public void testMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberPropertyDeclaration.kt");
}
@TestMetadata("nestedClassDeclaration.kt")
public void testNestedClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/nestedClassDeclaration.kt");
}
@TestMetadata("propertyDeclaration.kt")
public void testPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/propertyDeclaration.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/sealed")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -25623,6 +25623,59 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
}
}
@TestMetadata("compiler/testData/codegen/box/sameFileInSourceAndDependencies")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SameFileInSourceAndDependencies extends AbstractIrJsCodegenBoxES6Test {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
}
public void testAllFilesPresentInSameFileInSourceAndDependencies() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sameFileInSourceAndDependencies"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@TestMetadata("classDeclaration.kt")
public void testClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/classDeclaration.kt");
}
@TestMetadata("functionDeclaration.kt")
public void testFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/functionDeclaration.kt");
}
@TestMetadata("lateinitMemberPropertyDeclaration.kt")
public void testLateinitMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/lateinitMemberPropertyDeclaration.kt");
}
@TestMetadata("memberFunctionDeclaration.kt")
public void testMemberFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionDeclaration.kt");
}
@TestMetadata("memberFunctionWithDefaultArgumentsDeclaration.kt")
public void testMemberFunctionWithDefaultArgumentsDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionWithDefaultArgumentsDeclaration.kt");
}
@TestMetadata("memberPropertyDeclaration.kt")
public void testMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberPropertyDeclaration.kt");
}
@TestMetadata("nestedClassDeclaration.kt")
public void testNestedClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/nestedClassDeclaration.kt");
}
@TestMetadata("propertyDeclaration.kt")
public void testPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/propertyDeclaration.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/sealed")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -25044,6 +25044,59 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/sameFileInSourceAndDependencies")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SameFileInSourceAndDependencies extends AbstractIrJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInSameFileInSourceAndDependencies() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sameFileInSourceAndDependencies"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@TestMetadata("classDeclaration.kt")
public void testClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/classDeclaration.kt");
}
@TestMetadata("functionDeclaration.kt")
public void testFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/functionDeclaration.kt");
}
@TestMetadata("lateinitMemberPropertyDeclaration.kt")
public void testLateinitMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/lateinitMemberPropertyDeclaration.kt");
}
@TestMetadata("memberFunctionDeclaration.kt")
public void testMemberFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionDeclaration.kt");
}
@TestMetadata("memberFunctionWithDefaultArgumentsDeclaration.kt")
public void testMemberFunctionWithDefaultArgumentsDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionWithDefaultArgumentsDeclaration.kt");
}
@TestMetadata("memberPropertyDeclaration.kt")
public void testMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberPropertyDeclaration.kt");
}
@TestMetadata("nestedClassDeclaration.kt")
public void testNestedClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/nestedClassDeclaration.kt");
}
@TestMetadata("propertyDeclaration.kt")
public void testPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/propertyDeclaration.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/sealed")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -25004,6 +25004,59 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/sameFileInSourceAndDependencies")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SameFileInSourceAndDependencies extends AbstractJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInSameFileInSourceAndDependencies() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sameFileInSourceAndDependencies"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@TestMetadata("classDeclaration.kt")
public void testClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/classDeclaration.kt");
}
@TestMetadata("functionDeclaration.kt")
public void testFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/functionDeclaration.kt");
}
@TestMetadata("lateinitMemberPropertyDeclaration.kt")
public void testLateinitMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/lateinitMemberPropertyDeclaration.kt");
}
@TestMetadata("memberFunctionDeclaration.kt")
public void testMemberFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionDeclaration.kt");
}
@TestMetadata("memberFunctionWithDefaultArgumentsDeclaration.kt")
public void testMemberFunctionWithDefaultArgumentsDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionWithDefaultArgumentsDeclaration.kt");
}
@TestMetadata("memberPropertyDeclaration.kt")
public void testMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberPropertyDeclaration.kt");
}
@TestMetadata("nestedClassDeclaration.kt")
public void testNestedClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/nestedClassDeclaration.kt");
}
@TestMetadata("propertyDeclaration.kt")
public void testPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/propertyDeclaration.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/sealed")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -13586,6 +13586,59 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
}
}
@TestMetadata("compiler/testData/codegen/box/sameFileInSourceAndDependencies")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SameFileInSourceAndDependencies extends AbstractIrCodegenBoxWasmTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
}
public void testAllFilesPresentInSameFileInSourceAndDependencies() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sameFileInSourceAndDependencies"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
@TestMetadata("classDeclaration.kt")
public void testClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/classDeclaration.kt");
}
@TestMetadata("functionDeclaration.kt")
public void testFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/functionDeclaration.kt");
}
@TestMetadata("lateinitMemberPropertyDeclaration.kt")
public void testLateinitMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/lateinitMemberPropertyDeclaration.kt");
}
@TestMetadata("memberFunctionDeclaration.kt")
public void testMemberFunctionDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionDeclaration.kt");
}
@TestMetadata("memberFunctionWithDefaultArgumentsDeclaration.kt")
public void testMemberFunctionWithDefaultArgumentsDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberFunctionWithDefaultArgumentsDeclaration.kt");
}
@TestMetadata("memberPropertyDeclaration.kt")
public void testMemberPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/memberPropertyDeclaration.kt");
}
@TestMetadata("nestedClassDeclaration.kt")
public void testNestedClassDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/nestedClassDeclaration.kt");
}
@TestMetadata("propertyDeclaration.kt")
public void testPropertyDeclaration() throws Exception {
runTest("compiler/testData/codegen/box/sameFileInSourceAndDependencies/propertyDeclaration.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/sealed")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)