diff options
author | Sebastien Hertz <shertz@google.com> | 2013-03-05 15:12:40 +0100 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2013-03-06 16:33:16 +0100 |
commit | bf1442d5445405ddc4f67cdac2b4ebe2d37888e0 (patch) | |
tree | f82778f07e9988b6d5fe67b23f3f76765bf8aeab /test/082-inline-execute | |
parent | 4c1c283a7410784e9cab309f868248690b788a9c (diff) | |
download | art-bf1442d5445405ddc4f67cdac2b4ebe2d37888e0.tar.gz art-bf1442d5445405ddc4f67cdac2b4ebe2d37888e0.tar.bz2 art-bf1442d5445405ddc4f67cdac2b4ebe2d37888e0.zip |
Update intrinsic inlining test.
Adds invokes of StrictMath operations to reflect compiler inlining support.
Change-Id: Ibb2205a41c1e79ddbeacc2e716a9d05b723eb532
Diffstat (limited to 'test/082-inline-execute')
-rw-r--r-- | test/082-inline-execute/src/Main.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/082-inline-execute/src/Main.java b/test/082-inline-execute/src/Main.java index bae4d4f3aa..f4d2dd114a 100644 --- a/test/082-inline-execute/src/Main.java +++ b/test/082-inline-execute/src/Main.java @@ -26,6 +26,10 @@ public class Main { test_Math_abs_J(); test_Math_min(); test_Math_max(); + test_StrictMath_abs_I(); + test_StrictMath_abs_J(); + test_StrictMath_min(); + test_StrictMath_max(); test_String_charAt(); test_String_compareTo(); test_String_indexOf(); @@ -223,6 +227,7 @@ public class Main { Assert.assertEquals(Math.abs(Integer.MAX_VALUE), Integer.MAX_VALUE); Assert.assertEquals(Math.abs(Integer.MIN_VALUE), Integer.MIN_VALUE); Assert.assertEquals(Math.abs(Integer.MIN_VALUE - 1), Integer.MAX_VALUE); + Assert.assertEquals(Math.abs(Integer.MIN_VALUE + 1), Integer.MAX_VALUE); } public static void test_Math_abs_J() { @@ -252,6 +257,43 @@ public class Main { Assert.assertEquals(Math.max(Integer.MIN_VALUE, Integer.MAX_VALUE), Integer.MAX_VALUE); } + public static void test_StrictMath_abs_I() { + Assert.assertEquals(StrictMath.abs(0), 0); + Assert.assertEquals(StrictMath.abs(123), 123); + Assert.assertEquals(StrictMath.abs(-123), 123); + Assert.assertEquals(StrictMath.abs(Integer.MAX_VALUE), Integer.MAX_VALUE); + Assert.assertEquals(StrictMath.abs(Integer.MIN_VALUE), Integer.MIN_VALUE); + Assert.assertEquals(StrictMath.abs(Integer.MIN_VALUE - 1), Integer.MAX_VALUE); + Assert.assertEquals(StrictMath.abs(Integer.MIN_VALUE + 1), Integer.MAX_VALUE); + } + + public static void test_StrictMath_abs_J() { + Assert.assertEquals(StrictMath.abs(0L), 0L); + Assert.assertEquals(StrictMath.abs(123L), 123L); + Assert.assertEquals(StrictMath.abs(-123L), 123L); + Assert.assertEquals(StrictMath.abs(Long.MAX_VALUE), Long.MAX_VALUE); + Assert.assertEquals(StrictMath.abs(Long.MIN_VALUE), Long.MIN_VALUE); + Assert.assertEquals(StrictMath.abs(Long.MIN_VALUE - 1), Long.MAX_VALUE); + } + + public static void test_StrictMath_min() { + Assert.assertEquals(StrictMath.min(0, 0), 0); + Assert.assertEquals(StrictMath.min(1, 0), 0); + Assert.assertEquals(StrictMath.min(0, 1), 0); + Assert.assertEquals(StrictMath.min(0, Integer.MAX_VALUE), 0); + Assert.assertEquals(StrictMath.min(Integer.MIN_VALUE, 0), Integer.MIN_VALUE); + Assert.assertEquals(StrictMath.min(Integer.MIN_VALUE, Integer.MAX_VALUE), Integer.MIN_VALUE); + } + + public static void test_StrictMath_max() { + Assert.assertEquals(StrictMath.max(0, 0), 0); + Assert.assertEquals(StrictMath.max(1, 0), 1); + Assert.assertEquals(StrictMath.max(0, 1), 1); + Assert.assertEquals(StrictMath.max(0, Integer.MAX_VALUE), Integer.MAX_VALUE); + Assert.assertEquals(StrictMath.max(Integer.MIN_VALUE, 0), 0); + Assert.assertEquals(StrictMath.max(Integer.MIN_VALUE, Integer.MAX_VALUE), Integer.MAX_VALUE); + } + public static void test_Float_floatToRawIntBits() { Assert.assertEquals(Float.floatToRawIntBits(-1.0f), 0xbf800000); Assert.assertEquals(Float.floatToRawIntBits(0.0f), 0); |