< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java
Print this page
@@ -23,21 +23,19 @@
package org.graalvm.compiler.lir.jtt;
import org.graalvm.compiler.api.directives.GraalDirectives;
-import org.graalvm.compiler.core.common.PermanentBailoutException;
+import org.graalvm.compiler.asm.BranchTargetOutOfBoundsException;
import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.debug.DebugContext.Scope;
-import org.graalvm.compiler.debug.GraalError;
import org.graalvm.compiler.lir.LIRInstruction;
import org.graalvm.compiler.lir.LIRInstructionClass;
import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
import org.graalvm.compiler.lir.gen.LIRGeneratorTool;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
-import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
import jdk.vm.ci.code.BailoutException;
import jdk.vm.ci.meta.ResolvedJavaMethod;
@@ -80,22 +78,18 @@
}
return GraalDirectives.opaque(res);
}
@SuppressWarnings("try")
- @Test
+ @Test(expected = BranchTargetOutOfBoundsException.class)
public void testBailoutOnBranchOverflow() throws Throwable {
Assume.assumeTrue(getBackend().getTarget().arch instanceof SPARC);
ResolvedJavaMethod m = getResolvedJavaMethod("testBranch");
DebugContext debug = getDebugContext();
- try {
- try (Scope s = debug.disable()) {
- StructuredGraph graph = parseEager(m, AllowAssumptions.YES, debug);
- compile(m, graph);
- }
- } catch (GraalError e) {
- Assert.assertEquals(PermanentBailoutException.class, e.getCause().getClass());
+ try (Scope s = debug.disable()) {
+ StructuredGraph graph = parseEager(m, AllowAssumptions.YES, debug);
+ compile(m, graph);
}
}
public static class LargeOp extends LIRInstruction {
private static final LIRInstructionClass<LargeOp> TYPE = LIRInstructionClass.create(LargeOp.class);
< prev index next >