• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 public class Main {
18 
19   /// 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 
p(float arg)30   public static int p(float arg) {
31     return (arg > 5.0f) ? 0 : -1;
32   }
33 
34   /// 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 
main(String[] args)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 }
51