OSDN Git Service

Adding optimizing compiler test case for String.<init>.
authorJeff Hao <jeffhao@google.com>
Wed, 24 Jun 2015 00:34:04 +0000 (17:34 -0700)
committerJeff Hao <jeffhao@google.com>
Wed, 24 Jun 2015 17:34:41 +0000 (10:34 -0700)
Bug: 21991156

(cherry-picked from commit e7c7d8ed18a4e1d2291af78944ff913319ec1f23)

Change-Id: I282edaaa422f393629a09cb807da889422e33fb2

test/401-optimizing-compiler/src/Main.java

index 7c3fd25..a1e62b3 100644 (file)
@@ -110,6 +110,11 @@ public class Main {
     if (result != 42) {
       throw new Error("Unexpected result: " + result);
     }
+
+    String s = $opt$StringInit();
+    if (!s.equals("hello world")) {
+      throw new Error("Unexpected string: " + s);
+    }
   }
 
   public static void invokePrivate() {
@@ -230,5 +235,9 @@ public class Main {
     return array.length;
   }
 
+  public static String $opt$StringInit() {
+    return new String("hello world");
+  }
+
   Object o;
 }