Christoffer Quist Adamsen | 101d230 | 2018-06-12 16:44:10 +0200 | [diff] [blame] | 1 | // Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | |
| 5 | package classmerging; |
| 6 | |
| 7 | public class SuperCallRewritingTest { |
| 8 | public static void main(String[] args) { |
| 9 | System.out.println("Calling referencedMethod on SubClassThatReferencesSuperMethod"); |
Christoffer Quist Adamsen | bfdbe60 | 2019-10-18 12:03:31 +0200 | [diff] [blame] | 10 | SubClassThatReferencesSuperMethod obj = new SubClassThatReferencesSuperMethod(); |
| 11 | System.out.println(obj.referencedMethod()); |
| 12 | |
| 13 | // Ensure that the instantiations are not dead code eliminated. |
| 14 | escape(obj); |
| 15 | } |
| 16 | |
| 17 | @NeverInline |
| 18 | static void escape(Object o) { |
| 19 | if (System.currentTimeMillis() < 0) { |
| 20 | System.out.println(o); |
| 21 | } |
Christoffer Quist Adamsen | 101d230 | 2018-06-12 16:44:10 +0200 | [diff] [blame] | 22 | } |
| 23 | } |