Home | History | Annotate | Download | only in smali
      1 # Copyright (C) 2016 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 .class public LTestCase;
     16 
     17 .super Ljava/lang/Object;
     18 
     19 .field static private test1:Z
     20 
     21 .method public static topLevel()V
     22    .registers 1
     23    invoke-static {}, LTestCase;->$inline$foo()LUnresolved;
     24    return-void
     25 .end method
     26 
     27 # We need multiple returns to trigger the crash.
     28 .method public static $inline$foo()LUnresolved;
     29   .registers 2
     30   const v1, 0x0
     31   sget-boolean v0, LTestCase;->test1:Z
     32   if-eqz v0, :other_return
     33   return-object v1
     34   :other_return
     35   invoke-static {}, LTestCase;->$noinline$bar()LUnresolved;
     36   move-result-object v0
     37   return-object v0
     38 .end method
     39 
     40 .method public static $noinline$bar()LUnresolved;
     41   .registers 2
     42   const v1, 0x0
     43   sget-boolean v0, LTestCase;->test1:Z
     44   if-eqz v0, :return
     45   throw v1
     46   :return
     47   return-object v1
     48 .end method
     49