Add test for bug in nullness analysis

This commit is contained in:
Alexey Andreev 2024-08-25 19:34:20 +02:00
parent 4a345610cf
commit 0cda737dca
3 changed files with 28 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
@ -84,6 +85,12 @@ public class NullnessAnalysisTest {
test();
}
@Test
@Ignore
public void nonDominatedBranch2() {
test();
}
@Test
public void exception() {
test();

View File

@ -0,0 +1,10 @@
var @this as this // 0
$0
@a := invokeStatic `Foo.f()LBar;`
if @a === null then goto $2 else goto $1
$1
goto $2
$2
@c := phi @a_1 from $0, @a_2 from $1
@d := @a
return @c

View File

@ -0,0 +1,11 @@
var @this as this
$start
@a := invokeStatic `Foo.f()LBar;`
if @a === null then goto $joint else goto $ifNonNull
$ifNonNull
goto $joint
$joint
@c := phi @a from $start, @a from $ifNonNull
@d := @a
return @c