/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.oracle.graal.compiler.hsail.test.lambda; import com.amd.sumatra.SumatraUtils; import com.oracle.graal.compiler.hsail.test.infra.GraalKernelTester; import java.util.Arrays; import java.util.OptionalInt; import java.util.stream.*; import java.util.Random; import org.junit.*; public class OtherArgsWithCompSafepointTest extends GraalKernelTester{ Random r = new Random(); int[] makeIntArray(int size) { int[] out = new int[size]; for(int i=0; i { res[row] = 0; if (a != null) { for (int col = base; col < limit; col += stride) { // Use this line: it works //res[row] += a[col] + stride; // Use this line: it crashes when returning into // HSAIL JVM code beacuse callee saves are squashed in // StubRoutines::call_stub frame because the size of // restored locals is larger. res[row] += a[col] + b[col] + stride; } } }); } @Override public void runTest() { int[] a; int[] b; res = makeIntArray(rows); a = makeIntArray(cols); b = makeIntArray(cols); for (int i = 0; i < loops; i++) { innerTest(res, a, b, 0, 4); } } //@Test public void test() { testGeneratedHsail(); } @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); } }