1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/flow/tests/TestCaseIf.java Sat Sep 14 19:04:47 2013 +0100 1.3 @@ -0,0 +1,61 @@ 1.4 +/* /nodynamiccopyright/ */ 1.5 + 1.6 +public class TestCaseIf { 1.7 + 1.8 + @AliveRange(varName="o", bytecodeStart=9, bytecodeLength=5) 1.9 + @AliveRange(varName="o", bytecodeStart=17, bytecodeLength=1) 1.10 + void m0(String[] args) { 1.11 + Object o; 1.12 + if (args[0] != null) { 1.13 + o = ""; 1.14 + o.hashCode(); 1.15 + } 1.16 + o = ""; 1.17 + } 1.18 + 1.19 + @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=5) 1.20 + @AliveRange(varName="o", bytecodeStart=18, bytecodeLength=1) 1.21 + void m1() { 1.22 + Object o; 1.23 + int i = 5; 1.24 + if (i == 5) { 1.25 + o = ""; 1.26 + o.hashCode(); 1.27 + } 1.28 + o = ""; 1.29 + } 1.30 + 1.31 + @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=5) 1.32 + @AliveRange(varName="o", bytecodeStart=18, bytecodeLength=1) 1.33 + void m2() { 1.34 + Object o; 1.35 + int i = 5; 1.36 + if (!(i == 5)) { 1.37 + o = ""; 1.38 + o.hashCode(); 1.39 + } 1.40 + o = ""; 1.41 + } 1.42 + 1.43 + @AliveRange(varName="o", bytecodeStart=15, bytecodeLength=5) 1.44 + @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=1) 1.45 + void m3(String[] args) { 1.46 + Object o; 1.47 + if (args[0] != null && args[1] != null) { 1.48 + o = ""; 1.49 + o.hashCode(); 1.50 + } 1.51 + o = ""; 1.52 + } 1.53 + 1.54 + @AliveRange(varName="o", bytecodeStart=15, bytecodeLength=5) 1.55 + @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=1) 1.56 + void m4(String[] args) { 1.57 + Object o; 1.58 + if (args[0] != null || args[1] != null) { 1.59 + o = ""; 1.60 + o.hashCode(); 1.61 + } 1.62 + o = ""; 1.63 + } 1.64 +}