package compiler.loopopts.templated;
// --- IMPORTS start ---
import compiler.lib.ir_framework.*;
import compiler.lib.verify.*;
import compiler.lib.generators.*;
// --- IMPORTS end   ---
public class ReductionReassociation {
// --- CLASS_HOOK insertions start ---
// --- CLASS_HOOK insertions end   ---
    public static void main(String[] vmFlags) {
        TestFramework framework = new TestFramework(ReductionReassociation.class);
        framework.addFlags("-classpath", "/Users/g/src/jdk-avoid-cmov-long-min-max/JTwork/classes/compiler/loopopts/TestReductionReassociation.d:/Users/g/src/jdk-avoid-cmov-long-min-max/test/hotspot/jtreg/compiler/loopopts:/Users/g/src/jdk-avoid-cmov-long-min-max/JTwork/classes/compiler/loopopts/TestReductionReassociation.d/test/lib:/Users/g/src/jdk-avoid-cmov-long-min-max/test/lib:/Users/g/src/jdk-avoid-cmov-long-min-max/test/hotspot/jtreg:/Users/g/opt/jtreg/build/images/jtreg/lib/javatest.jar:/Users/g/opt/jtreg/build/images/jtreg/lib/jtreg.jar:/Users/g/src/jdk-avoid-cmov-long-min-max/JTwork/scratch/./compile-framework-classes-16489072318119028520");
        framework.addFlags(vmFlags);
        framework.start();
    }
// --- LIST OF TESTS start ---
// --- test_2 start ---

private static long[] input_MAX_L_2 = new long[10000];
static {
    Generators.G.fill(Generators.G.longs(), input_MAX_L_2);
}
private Object[] expected_MAX_L_2 = test_MAX_L_2();
@Test
@IR(counts = {IRNode.MAX_L, "= 4"}, phase = CompilePhase.AFTER_LOOP_OPTS)
public Object[] test_MAX_L_2() {
    long result = Integer.MIN_VALUE;
    long result2 = Integer.MIN_VALUE;
    for (int i = 0; i < input_MAX_L_2.length; i += 4) {
        long v0 = input_MAX_L_2[i + 0];
        long v1 = input_MAX_L_2[i + 1];
        long v2 = input_MAX_L_2[i + 2];
        long v3 = input_MAX_L_2[i + 3];
long u0 = Math.max(v0, result);long u1 = Math.max(v1, u0);long u2 = Math.max(v2, u1);long u3 = Math.max(v3, u2);result = u3;long t0 = Math.max(v0, v1);long t1 = Math.max(v2, v3);long t2 = Math.max(t0, t1);long t3 = Math.max(result, t2);result2 = t3;    }
    return new Object[]{result, result2};
}
@Check(test = "test_MAX_L_2")
public void check_MAX_L_2(Object[] results) {
    Verify.checkEQ(expected_MAX_L_2[0], results[0]);
    Verify.checkEQ(expected_MAX_L_2[1], results[1]);
    Verify.checkEQ(results[0], results[1]);
}

// --- test_2 end ---
// --- LIST OF TESTS end   ---
}
