Search in sources :

Example 11 with UnsignedLong

use of org.graalvm.compiler.core.common.util.UnsignedLong in project graal by oracle.

the class UnsignedLongTest method testPlusException2.

@Test(expected = ArithmeticException.class)
public void testPlusException2() {
    UnsignedLong longUnsigned = new UnsignedLong(0xffff_ffff_ffff_fff0L);
    longUnsigned.plus(42);
}
Also used : UnsignedLong(org.graalvm.compiler.core.common.util.UnsignedLong) Test(org.junit.Test)

Example 12 with UnsignedLong

use of org.graalvm.compiler.core.common.util.UnsignedLong in project graal by oracle.

the class UnsignedLongTest method testMinus.

@Test
public void testMinus() {
    UnsignedLong fortyTwo = new UnsignedLong(42);
    Assert.assertEquals(0, fortyTwo.minus(42).asLong());
    Assert.assertEquals(40, fortyTwo.minus(2).asLong());
    UnsignedLong longUnsigned = new UnsignedLong(0xffff_ffff_ffff_fff0L);
    Assert.assertEquals(0, longUnsigned.minus(0xffff_ffff_ffff_fff0L).asLong());
}
Also used : UnsignedLong(org.graalvm.compiler.core.common.util.UnsignedLong) Test(org.junit.Test)

Example 13 with UnsignedLong

use of org.graalvm.compiler.core.common.util.UnsignedLong in project graal by oracle.

the class UnsignedLongTest method testPlus.

@Test
public void testPlus() {
    UnsignedLong fortyTwo = new UnsignedLong(42);
    Assert.assertEquals(84, fortyTwo.plus(42).asLong());
    Assert.assertEquals(44, fortyTwo.plus(2).asLong());
    UnsignedLong longUnsigned = new UnsignedLong(0xffff_ffff_ffff_fff0L);
    Assert.assertEquals(0xffff_ffff_ffff_ffffL, longUnsigned.plus(0xf).asLong());
}
Also used : UnsignedLong(org.graalvm.compiler.core.common.util.UnsignedLong) Test(org.junit.Test)

Example 14 with UnsignedLong

use of org.graalvm.compiler.core.common.util.UnsignedLong in project graal by oracle.

the class UnsignedLongTest method testPlusException.

@Test(expected = ArithmeticException.class)
public void testPlusException() {
    UnsignedLong fortyTwo = new UnsignedLong(42);
    fortyTwo.plus(0xffff_ffff_ffff_fff0L);
}
Also used : UnsignedLong(org.graalvm.compiler.core.common.util.UnsignedLong) Test(org.junit.Test)

Aggregations

UnsignedLong (org.graalvm.compiler.core.common.util.UnsignedLong)14 Test (org.junit.Test)13 OptionValues (org.graalvm.compiler.options.OptionValues)1