Ian Zerny | 31054bb | 2017-10-10 12:12:53 +0200 | [diff] [blame] | 1 | // Copyright (c) 2017, 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 | public class SharedCode { |
| 6 | |
| 7 | public static int sharedIf(int x) { |
| 8 | if (x == 0) { |
| 9 | doit(1); doit(2); doit(1); doit(2); |
| 10 | } else { |
| 11 | doit(1); doit(2); doit(1); doit(2); |
| 12 | } |
| 13 | return x; |
| 14 | } |
| 15 | |
| 16 | |
| 17 | public static void doit(int x) { |
| 18 | // nothing to do really. |
| 19 | } |
| 20 | |
| 21 | public static void main(String[] args) { |
| 22 | System.out.println(sharedIf(0)); |
| 23 | System.out.println(sharedIf(1)); |
| 24 | } |
| 25 | } |