blob: a811e5bb16bbce343b143550a3a98391405f6fb7 [file] [log] [blame]
David Brazdilb3e773e2016-01-26 11:28:37 +00001/*
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
17public class Main {
18
19 /// CHECK-START: void Main.main(java.lang.String[]) liveness (after)
20 /// CHECK: <<X:i\d+>> ArrayLength uses:[<<UseInput:\d+>>]
21 /// CHECK: <<Y:i\d+>> StaticFieldGet uses:[<<UseInput>>]
22 /// CHECK: <<Cond:z\d+>> LessThanOrEqual [<<X>>,<<Y>>]
23 /// CHECK-NEXT: If [<<Cond>>] liveness:<<LivIf:\d+>>
24 /// CHECK-EVAL: <<UseInput>> == <<LivIf>> + 1
25
26 public static void main(String[] args) {
27 int x = args.length;
28 int y = field;
29 if (x > y) {
30 System.nanoTime();
31 }
32 }
33
34 public static int field = 42;
35}