Søren Gjesse | f1e2fc9 | 2017-08-29 14:13:12 +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 ClassInitializerStaticBlockInitialization { |
| 6 | |
| 7 | static boolean b; |
| 8 | static int x; |
| 9 | static int y; |
| 10 | |
| 11 | static { |
| 12 | x = 1; |
| 13 | x = 2; |
| 14 | if (b) { |
| 15 | y = 1; |
| 16 | } else { |
| 17 | y = 2; |
| 18 | } |
| 19 | x = 3; |
| 20 | } |
| 21 | |
| 22 | public static void main(String[] args) { |
| 23 | System.out.println("x=" + x); |
| 24 | System.out.println("y=" + y); |
| 25 | } |
| 26 | } |