1 /*
2  * Copyright (C) 2017 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 class Unrelated {
18 }
19 
20 public class Main {
21 
22   /// CHECK-START: int Main.inlineMonomorphic(Main) inliner (before)
23   /// CHECK:       InvokeVirtual method_name:Main.getValue
24 
25   /// CHECK-START: int Main.inlineMonomorphic(Main) inliner (after)
26   /// CHECK:   InvokeVirtual method_name:Main.getValue
27 
inlineMonomorphic(Main a)28   public static int inlineMonomorphic(Main a) {
29     return a.getValue();
30   }
31 
32   /// CHECK-START: int Main.inlinePolymorphic(Main) inliner (before)
33   /// CHECK:       InvokeVirtual method_name:Main.getValue
34 
35   /// CHECK-START: int Main.inlinePolymorphic(Main) inliner (after)
36   /// CHECK:   InvokeVirtual method_name:Main.getValue
inlinePolymorphic(Main a)37   public static int inlinePolymorphic(Main a) {
38     return a.getValue();
39   }
40 
getValue()41   public int getValue() {
42     return 42;
43   }
44 
main(String[] args)45   public static void main(String[] args) {
46     inlineMonomorphic(new Main());
47   }
48 
49 }
50