commit | bfdbe6064d1203fae3b70da76a572d5fc5577ca9 | [log] [tgz] |
---|---|---|
author | Christoffer Quist Adamsen <christofferqa@google.com> | Fri Oct 18 12:03:31 2019 +0200 |
committer | Christoffer Quist Adamsen <christofferqa@google.com> | Fri Oct 18 12:03:31 2019 +0200 |
tree | 49344c07fa0181f7fce4aa0471863abad54df8ac | |
parent | 46be366c34e8506201d0eaef977ff73f6d534c36 [diff] [blame] |
Allow clinits that create a singleton instance to be postponed Bug: 142762129 Change-Id: Iaa472dcf1b52dad304488ed3855fbceb16f20f9d
diff --git a/src/test/examples/classmerging/SyntheticBridgeSignaturesTest.java b/src/test/examples/classmerging/SyntheticBridgeSignaturesTest.java index a17d30a..c263e98 100644 --- a/src/test/examples/classmerging/SyntheticBridgeSignaturesTest.java +++ b/src/test/examples/classmerging/SyntheticBridgeSignaturesTest.java
@@ -15,6 +15,17 @@ BSub b = new BSub(); a.m(b); b.m(a); + + // Ensure that the instantiations are not dead code eliminated. + escape(a); + escape(b); + } + + @NeverInline + static void escape(Object o) { + if (System.currentTimeMillis() < 0) { + System.out.println(o); + } } private static class A {