Christoffer Quist Adamsen | 722c9f6 | 2018-07-04 16:23:25 +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 | package classmerging; |
| 5 | |
| 6 | public class ClassWithNativeMethodTest { |
| 7 | |
| 8 | public static void main(String[] args) { |
| 9 | B obj = new B(); |
| 10 | |
| 11 | // Make sure that A.method is not removed by tree shaking. |
| 12 | if (args.length == 42) { |
| 13 | obj.method(); |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | public static class A { |
| 18 | public native void method(); |
| 19 | } |
| 20 | |
| 21 | public static class B extends A {} |
| 22 | } |