[AA] Fix compilation facility "multi binary module" test module structure

- The module structure for these tests was set up backwards: We should
  keep the test module kind of the main module flexible (as it is
  configured by test configurators), but keep the module kinds of the
  binary libraries fixed.

^KT-65960
^KT-64994
This commit is contained in:
Marco Pennekamp
2024-02-26 16:37:39 +01:00
committed by Space Team
parent 4ea3de1760
commit b5eccd63b1
17 changed files with 43 additions and 95 deletions
@@ -0,0 +1,6 @@
MODULE_FRAGMENT
FILE fqName:<root> fileName:main.kt
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (): kotlin.Int declared in <root>'
CALL 'public final fun bar (): kotlin.Int declared in p2' type=kotlin.Int origin=null
@@ -0,0 +1,19 @@
// MODULE: lib
// MODULE_KIND: LibraryBinary
// FILE: p3/foo.kt
package p3
fun foo() = 3
// MODULE: lib2(lib)
// MODULE_KIND: LibraryBinary
// FILE: p2/bar.kt
package p2
fun bar() = 4 + p3.foo()
// MODULE: main(lib, lib2)
// FILE: main.kt
import p2.bar
fun test() = bar()
@@ -0,0 +1,4 @@
public final class MainKt {
// source: 'main.kt'
public final static method test(): int
}
@@ -0,0 +1,40 @@
MODULE_FRAGMENT
FILE fqName:<root> fileName:main.kt
CLASS CLASS name:Child modality:FINAL visibility:public superTypes:[p2.Parent]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Child
CONSTRUCTOR visibility:public <> () returnType:<root>.Child [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in p2.Parent'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Child modality:FINAL visibility:public superTypes:[p2.Parent]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in p2.Parent
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in p2.Parent
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:setContentView visibility:public modality:OPEN <> ($this:p2.Parent, p0:kotlin.Int) returnType:kotlin.Unit [fake_override]
overridden:
public open fun setContentView (p0: kotlin.Int): kotlin.Unit declared in p2.Parent
$this: VALUE_PARAMETER name:<this> type:p2.Parent
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
annotations:
Anno(value = ["UnknownNullness", "MissingNullability"])
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in p2.Parent
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:bar visibility:private modality:FINAL <> ($this:<root>.Child) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Child
BLOCK_BODY
FUN name:onCreate visibility:protected modality:OPEN <> ($this:<root>.Child) returnType:kotlin.Unit
overridden:
protected/*protected and package*/ open fun onCreate (): kotlin.Unit declared in p2.Parent
$this: VALUE_PARAMETER name:<this> type:<root>.Child
BLOCK_BODY
CALL 'protected/*protected and package*/ open fun onCreate (): kotlin.Unit declared in p2.Parent' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:Parent modality:OPEN visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Child declared in <root>.Child.onCreate' type=<root>.Child origin=null
CALL 'private final fun bar (): kotlin.Unit declared in <root>.Child' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Child declared in <root>.Child.onCreate' type=<root>.Child origin=null
@@ -0,0 +1,45 @@
// MODULE: lib
// MODULE_KIND: LibraryBinary
// FILE: p3/Anno.java
package p3;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
@Retention(RetentionPolicy.CLASS)
public @interface Anno {
String[] value();
}
// MODULE: lib2(lib)
// MODULE_KIND: LibraryBinary
// FILE: p2/Parent.java
package p2;
import p3.Anno;
public class Parent {
protected void onCreate() {
setContentView(10);
}
public void setContentView(@Anno({"UnknownNullness", "MissingNullability"}) int id) {
}
}
// MODULE: main(lib, lib2)
// FILE: main.kt
import p2.Parent
class Child: Parent() {
override fun onCreate() {
super.onCreate()
bar()
}
private fun bar() {}
}
@@ -0,0 +1,6 @@
public final class Child {
// source: 'main.kt'
public method <init>(): void
private final method bar(): void
protected method onCreate(): void
}