mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Add test for bug in nullness analysis
This commit is contained in:
parent
4a345610cf
commit
0cda737dca
|
@ -29,6 +29,7 @@ import java.io.InputStreamReader;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.TestName;
|
import org.junit.rules.TestName;
|
||||||
|
@ -84,6 +85,12 @@ public class NullnessAnalysisTest {
|
||||||
test();
|
test();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Ignore
|
||||||
|
public void nonDominatedBranch2() {
|
||||||
|
test();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void exception() {
|
public void exception() {
|
||||||
test();
|
test();
|
||||||
|
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue
Block a user