Allow clinits that create a singleton instance to be postponed

Bug: 142762129
Change-Id: Iaa472dcf1b52dad304488ed3855fbceb16f20f9d
diff --git a/src/test/examplesAndroidO/classmerging/NestedDefaultInterfaceMethodsTest.java b/src/test/examplesAndroidO/classmerging/NestedDefaultInterfaceMethodsTest.java
index 7a0e325..f237c2e 100644
--- a/src/test/examplesAndroidO/classmerging/NestedDefaultInterfaceMethodsTest.java
+++ b/src/test/examplesAndroidO/classmerging/NestedDefaultInterfaceMethodsTest.java
@@ -7,7 +7,18 @@
 public class NestedDefaultInterfaceMethodsTest {
 
   public static void main(String[] args) {
-    new C().m();
+    C obj = new C();
+    obj.m();
+
+    // Ensure that the instantiations are not dead code eliminated.
+    escape(obj);
+  }
+
+  @NeverInline
+  static void escape(Object o) {
+    if (System.currentTimeMillis() < 0) {
+      System.out.println(o);
+    }
   }
 
   public interface A {