1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17class Main {
18  private static boolean $inline$false() { return false; }
19
20  /// CHECK-START: void Main.main(java.lang.String[]) dead_code_elimination$initial (before)
21  /// CHECK-DAG:     <<Const0:i\d+>> IntConstant 0
22  /// CHECK-DAG:     <<Const1:i\d+>> IntConstant 1
23  /// CHECK-DAG:     <<Phi:i\d+>>    Phi [<<Const0>>,<<Add:i\d+>>] loop:{{B\d+}}
24  /// CHECK-DAG:                     InvokeVirtual [{{l\d+}},<<Phi>>] method_name:java.io.PrintStream.println
25  /// CHECK-DAG:     <<Add>>         Add [<<Phi>>,<<Const1>>]
26
27  public static void main(String[] args) {
28    if ($inline$false()) {
29      int x = 0;
30      while (true) {
31        System.out.println(x++);
32      }
33    }
34  }
35}
36