--- old/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java 2017-03-06 09:06:45.482041125 +0100 +++ new/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java 2017-03-06 09:06:45.418041128 +0100 @@ -26,6 +26,7 @@ /* * @test * @library /testlibrary /test/lib /compiler/whitebox / + * @requires os.simpleArch == "x64" * @build compiler.valhalla.valuetypes.ValueTypeTestBench * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller jdk.test.lib.Platform @@ -711,25 +712,29 @@ } // Test OSR compilation - @Test(failOn = ALLOC + LOAD + STORE + LOOP + TRAP) + @Test() public long test23() { MyValue1 v = MyValue1.createInline(rI, rL); - // TODO add OSR testcase for value type arrays - //MyValue1[] va = new MyValue1[10]; + MyValue1[] va = new MyValue1[Math.abs(rI) % 3]; + for (int i = 0; i < va.length; ++i) { + va[i] = MyValue1.createInline(rI, rL); + } long result = 0; // Long loop to trigger OSR compilation - for (int i = 0 ; i < 100_000 ; ++i) { + for (int i = 0 ; i < 100_000; ++i) { // Reference local value type in interpreter state - result = v.hash(); // + va[0].hash(); + result = v.hash(); + for (int j = 0; j < va.length; ++j) { + result += va[j].hash(); + } } return result; } @DontCompile public void test23_verifier(boolean warmup) { - //MyValue1[] va = new MyValue1[10]; long result = test23(); - Asserts.assertEQ(result, hash() /* + va[0].hash() */); + Asserts.assertEQ(result, ((Math.abs(rI) % 3) + 1) * hash()); } // Test interpreter to compiled code with various signatures