summaryrefslogtreecommitdiffstats
path: root/test/083-compiler-regressions
diff options
context:
space:
mode:
authorAlexei Zavjalov <alexei.zavjalov@intel.com>2014-07-30 19:31:04 +0700
committerAlexei Zavjalov <alexei.zavjalov@intel.com>2014-07-31 02:35:49 +0700
commit54659e3a2c83d3949957a10436e55e525a430a15 (patch)
treec49f155975190dedff9794c89fc738edaed3f999 /test/083-compiler-regressions
parentf90283f61d6ca37abf3a9fb8447d05e79caf0160 (diff)
downloadart-54659e3a2c83d3949957a10436e55e525a430a15.zip
art-54659e3a2c83d3949957a10436e55e525a430a15.tar.gz
art-54659e3a2c83d3949957a10436e55e525a430a15.tar.bz2
ART: LoadConstWide should clobber temp reg
If we have 2+ LoadConstWide(FP) calls in one method it is possible that LoadConstWide will load the method poiner only once. In some cases, for example, if we have branches, initialization might not be done and it may lead to a segmentation fault. Change-Id: If45fc2d1109d7ce9bd272f5c56446b2a6884daac Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
Diffstat (limited to 'test/083-compiler-regressions')
-rw-r--r--test/083-compiler-regressions/expected.txt1
-rw-r--r--test/083-compiler-regressions/src/Main.java15
2 files changed, 16 insertions, 0 deletions
diff --git a/test/083-compiler-regressions/expected.txt b/test/083-compiler-regressions/expected.txt
index 9f57dbd..f8d92cc 100644
--- a/test/083-compiler-regressions/expected.txt
+++ b/test/083-compiler-regressions/expected.txt
@@ -37,3 +37,4 @@ ManyFloatArgs passes
atomicLong passes
LiveFlags passes trip 3
LiveFlags passes trip 1
+minDoubleWith3ConstsTest passes
diff --git a/test/083-compiler-regressions/src/Main.java b/test/083-compiler-regressions/src/Main.java
index 748b0de..c089c52 100644
--- a/test/083-compiler-regressions/src/Main.java
+++ b/test/083-compiler-regressions/src/Main.java
@@ -58,6 +58,21 @@ public class Main {
ManyFloatArgs();
atomicLong();
LiveFlags.test();
+ minDoubleWith3ConstsTest();
+ }
+
+ public static double minDouble(double a, double b, double c) {
+ return Math.min(Math.min(a, b), c);
+ }
+
+ public static void minDoubleWith3ConstsTest() {
+ double result = minDouble(1.2, 2.5, Double.NaN);
+ if (Double.isNaN(result)) {
+ System.out.println("minDoubleWith3ConstsTest passes");
+ } else {
+ System.out.println("minDoubleWith3ConstsTest fails: " + result +
+ " (expecting NaN)");
+ }
}
public static void atomicLong() {