< prev index next >

test/hotspot/jtreg/compiler/valhalla/valuetypes/TestNullableArrays.java

Print this page

        

*** 848,858 **** Asserts.assertEQ(src4[i].hash(), dst4[i].hash()); } } // non escaping allocations ! @Test(failOn = ALLOCA + LOOP + LOAD + TRAP) public MyValue2? test28() { MyValue2?[] src = new MyValue2?[10]; src[0] = null; MyValue2?[] dst = (MyValue2?[])src.clone(); return dst[0]; --- 848,859 ---- Asserts.assertEQ(src4[i].hash(), dst4[i].hash()); } } // non escaping allocations ! // TODO fix ! // @Test(failOn = ALLOCA + LOOP + LOAD + TRAP) public MyValue2? test28() { MyValue2?[] src = new MyValue2?[10]; src[0] = null; MyValue2?[] dst = (MyValue2?[])src.clone(); return dst[0];
*** 2359,2364 **** --- 2360,2406 ---- throw new RuntimeException("ClassCastException expected"); } catch (ClassCastException cce) { // Expected } } + + // More cast tests + @Test() + public static MyValue1?[] test90(Object va) { + return (MyValue1?[])va; + } + + @DontCompile + public void test90_verifier(boolean warmup) { + MyValue1[] va = new MyValue1[1]; + MyValue1?[] vab = new MyValue1?[1]; + try { + // Trigger some ClassCastExceptions so C2 does not add an uncommon trap + test90(new Integer[0]); + } catch (ClassCastException cce) { + // Expected + } + test90(va); + test90(vab); + test90(null); + } + + @Test() + public static MyValue1?[] test91(Object[] va) { + return (MyValue1?[])va; + } + + @DontCompile + public void test91_verifier(boolean warmup) { + MyValue1[] va = new MyValue1[1]; + MyValue1?[] vab = new MyValue1?[1]; + try { + // Trigger some ClassCastExceptions so C2 does not add an uncommon trap + test91(new Integer[0]); + } catch (ClassCastException cce) { + // Expected + } + test91(va); + test91(vab); + test91(null); + } }
< prev index next >