clementbera | 7288597 | 2019-05-21 12:30:02 +0200 | [diff] [blame] | 1 | // Copyright (c) 2019, 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 | |
clementbera | be19d30 | 2019-05-23 17:23:21 +0200 | [diff] [blame] | 5 | package nesthostexample; |
clementbera | 948e418 | 2019-05-14 12:25:26 +0200 | [diff] [blame] | 6 | |
| 7 | public class BasicNestHostTreePruning { |
| 8 | |
| 9 | private String field = "NotPruned"; |
| 10 | |
| 11 | public static class NotPruned extends BasicNestHostTreePruning { |
| 12 | |
clementbera | d5bd4f3 | 2019-05-21 12:22:06 +0200 | [diff] [blame] | 13 | @NeverInline |
clementbera | 948e418 | 2019-05-14 12:25:26 +0200 | [diff] [blame] | 14 | public String getFields() { |
| 15 | return ((BasicNestHostTreePruning) this).field; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | public static class Pruned { |
| 20 | |
| 21 | public static void main(String[] args) { |
| 22 | System.out.println("NotPruned"); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | public static void main(String[] args) { |
| 27 | System.out.println(new NotPruned().getFields()); |
| 28 | } |
| 29 | } |