blob: acfcecdba8121ee98631d7fd0cf3e566e8135cdc [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
Mark P Mendell2f10a5f2016-01-25 14:47:50 +000019 /// CHECK-START-X86: int Main.p(float) liveness (after)
20 /// CHECK: <<Arg:f\d+>> ParameterValue uses:[<<UseInput:\d+>>]
21 /// CHECK-DAG: <<Five:f\d+>> FloatConstant 5 uses:[<<UseInput>>]
22 /// CHECK-DAG: <<Zero:i\d+>> IntConstant 0
23 /// CHECK-DAG: <<MinusOne:i\d+>> IntConstant -1 uses:[<<UseInput>>]
24 /// CHECK: <<Base:i\d+>> X86ComputeBaseMethodAddress uses:[<<UseInput>>]
25 /// CHECK-NEXT: <<Load:f\d+>> X86LoadFromConstantTable [<<Base>>,<<Five>>]
26 /// CHECK-NEXT: <<Cond:z\d+>> LessThanOrEqual [<<Arg>>,<<Load>>]
27 /// CHECK-NEXT: Select [<<Zero>>,<<MinusOne>>,<<Cond>>] liveness:<<LivSel:\d+>>
28 /// CHECK-EVAL: <<UseInput>> == <<LivSel>> + 1
29
30 public static int p(float arg) {
David Brazdil40e4ba22016-03-02 13:25:57 +000031 return (arg > 5.0f) ? 0 : -1;
Mark P Mendell2f10a5f2016-01-25 14:47:50 +000032 }
33
David Brazdilb3e773e2016-01-26 11:28:37 +000034 /// CHECK-START: void Main.main(java.lang.String[]) liveness (after)
35 /// CHECK: <<X:i\d+>> ArrayLength uses:[<<UseInput:\d+>>]
36 /// CHECK: <<Y:i\d+>> StaticFieldGet uses:[<<UseInput>>]
37 /// CHECK: <<Cond:z\d+>> LessThanOrEqual [<<X>>,<<Y>>]
38 /// CHECK-NEXT: If [<<Cond>>] liveness:<<LivIf:\d+>>
39 /// CHECK-EVAL: <<UseInput>> == <<LivIf>> + 1
40
41 public static void main(String[] args) {
42 int x = args.length;
43 int y = field;
44 if (x > y) {
45 System.nanoTime();
46 }
47 }
48
49 public static int field = 42;
50}