提交 718f0240 编写于 作者: M Mikhail Glukhikh

[FIR TEST] Add problematic CFG test

上级 a476d1db
digraph secondaryConstructorCfg_kt {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter function <init>" style="filled" fillcolor=red];
2 [label="Delegated constructor call: super<R|kotlin/Any|>()"];
1 [label="Exit function <init>" style="filled" fillcolor=red];
}
0 -> {2};
2 -> {1};
subgraph cluster_1 {
color=red
20 [label="Enter function <init>" style="filled" fillcolor=red];
22 [label="Access variable R|<local>/p0|"];
23 [label="Delegated constructor call: this<R|B|>(...)"];
subgraph cluster_2 {
color=blue
24 [label="Enter block"];
25 [label="Access variable R|<local>/p1|"];
26 [label="Assignment: R|/B.p3|"];
27 [label="Exit block"];
}
21 [label="Exit function <init>" style="filled" fillcolor=red style="filled" fillcolor=gray];
}
20 -> {22};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
subgraph cluster_3 {
color=red
37 [label="Enter class B" style="filled" fillcolor=red];
subgraph cluster_4 {
color=blue
16 [label="Enter function setter" style="filled" fillcolor=red];
17 [label="Exit function setter" style="filled" fillcolor=red];
}
subgraph cluster_5 {
color=blue
14 [label="Enter function getter" style="filled" fillcolor=red];
15 [label="Exit function getter" style="filled" fillcolor=red];
}
subgraph cluster_6 {
color=blue
8 [label="Enter function getter" style="filled" fillcolor=red];
9 [label="Exit function getter" style="filled" fillcolor=red];
}
subgraph cluster_7 {
color=blue
3 [label="Enter function getter" style="filled" fillcolor=red];
4 [label="Exit function getter" style="filled" fillcolor=red];
}
subgraph cluster_8 {
color=blue
5 [label="Enter property" style="filled" fillcolor=red];
7 [label="Access variable R|<local>/p0|"];
6 [label="Exit property" style="filled" fillcolor=red];
}
subgraph cluster_9 {
color=blue
10 [label="Enter property" style="filled" fillcolor=red];
12 [label="Access variable R|<local>/p0|"];
13 [label="Access variable R|kotlin/String.length|"];
11 [label="Exit property" style="filled" fillcolor=red];
}
subgraph cluster_10 {
color=blue
18 [label="Enter property" style="filled" fillcolor=red];
19 [label="Exit property" style="filled" fillcolor=red];
}
subgraph cluster_11 {
color=blue
28 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_12 {
color=blue
30 [label="Enter block"];
31 [label="Access variable R|<local>/p0|"];
32 [label="Access variable R|kotlin/String.length|"];
33 [label="Assignment: R|/B.p1|"];
34 [label="Const: String()"];
35 [label="Assignment: R|/B.p3|"];
36 [label="Exit block"];
}
29 [label="Exit init block" style="filled" fillcolor=red];
}
38 [label="Exit class B" style="filled" fillcolor=red];
}
37 -> {5} [color=green];
5 -> {7};
6 -> {10} [color=green];
7 -> {6};
3 -> {4};
10 -> {12};
11 -> {18} [color=green];
12 -> {13};
13 -> {11};
8 -> {9};
18 -> {19};
19 -> {28} [color=green];
14 -> {15};
16 -> {17};
28 -> {30};
29 -> {38} [color=green];
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {29};
}
// !DUMP_CFG
class B(p0: String) {
val p1 = p0
val p2: Int = p0.length
var p3: String
constructor(p0: String, p1: String) : this(p0) {
p3 = p1
}
init {
p1 = p0.length
p3 = ""
}
}
\ No newline at end of file
FILE: secondaryConstructorCfg.kt
public final class B : R|kotlin/Any| {
public constructor(p0: R|kotlin/String|): R|B| {
super<R|kotlin/Any|>()
}
public final val p1: R|kotlin/String| = R|<local>/p0|
public get(): R|kotlin/String|
public final val p2: R|kotlin/Int| = R|<local>/p0|.R|kotlin/String.length|
public get(): R|kotlin/Int|
public final var p3: R|kotlin/String|
public get(): R|kotlin/String|
public set(value: R|kotlin/String|): R|kotlin/Unit|
public constructor(p0: R|kotlin/String|, p1: R|kotlin/String|): R|B| {
this<R|B|>(R|<local>/p0|)
this@R|/B|.R|/B.p3| = R|<local>/p1|
}
init {
this@R|/B|.R|/B.p1| = R|<local>/p0|.R|kotlin/String.length|
this@R|/B|.R|/B.p3| = String()
}
}
......@@ -1693,6 +1693,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
public void testSafeCallInvoke() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.kt");
}
@TestMetadata("secondaryConstructorCfg.kt")
public void testSecondaryConstructorCfg() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.kt");
}
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/properties")
......
......@@ -1693,6 +1693,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
public void testSafeCallInvoke() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.kt");
}
@TestMetadata("secondaryConstructorCfg.kt")
public void testSecondaryConstructorCfg() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.kt");
}
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/properties")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册