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 LSmaliTests;
     16 .super Ljava/lang/Object;
     17 
     18 ## CHECK-START: int SmaliTests.EqualTrueRhs(boolean) instruction_simplifier (before)
     19 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
     20 ## CHECK-DAG:     <<Const1:i\d+>>   IntConstant 1
     21 ## CHECK-DAG:     <<Cond:z\d+>>     Equal [<<Arg>>,<<Const1>>]
     22 ## CHECK-DAG:                       If [<<Cond>>]
     23 
     24 ## CHECK-START: int SmaliTests.EqualTrueRhs(boolean) instruction_simplifier (after)
     25 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
     26 ## CHECK-DAG:                       If [<<Arg>>]
     27 
     28 .method public static EqualTrueRhs(Z)I
     29   .registers 3
     30 
     31   const v0, 0x1
     32   const v1, 0x5
     33   if-eq p0, v0, :return
     34   const v1, 0x3
     35   :return
     36   return v1
     37 
     38 .end method
     39 
     40 ## CHECK-START: int SmaliTests.EqualTrueLhs(boolean) instruction_simplifier (before)
     41 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
     42 ## CHECK-DAG:     <<Const1:i\d+>>   IntConstant 1
     43 ## CHECK-DAG:     <<Cond:z\d+>>     Equal [<<Const1>>,<<Arg>>]
     44 ## CHECK-DAG:                       If [<<Cond>>]
     45 
     46 ## CHECK-START: int SmaliTests.EqualTrueLhs(boolean) instruction_simplifier (after)
     47 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
     48 ## CHECK-DAG:                       If [<<Arg>>]
     49 
     50 .method public static EqualTrueLhs(Z)I
     51   .registers 3
     52 
     53   const v0, 0x1
     54   const v1, 0x5
     55   if-eq v0, p0, :return
     56   const v1, 0x3
     57   :return
     58   return v1
     59 
     60 .end method
     61 
     62 ## CHECK-START: int SmaliTests.EqualFalseRhs(boolean) instruction_simplifier (before)
     63 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
     64 ## CHECK-DAG:     <<Const0:i\d+>>   IntConstant 0
     65 ## CHECK-DAG:     <<Cond:z\d+>>     Equal [<<Arg>>,<<Const0>>]
     66 ## CHECK-DAG:                       If [<<Cond>>]
     67 
     68 ## CHECK-START: int SmaliTests.EqualFalseRhs(boolean) instruction_simplifier (after)
     69 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
     70 ## CHECK-DAG:                       If [<<Arg>>]
     71 
     72 .method public static EqualFalseRhs(Z)I
     73   .registers 3
     74 
     75   const v0, 0x0
     76   const v1, 0x3
     77   if-eq p0, v0, :return
     78   const v1, 0x5
     79   :return
     80   return v1
     81 
     82 .end method
     83 
     84 ## CHECK-START: int SmaliTests.EqualFalseLhs(boolean) instruction_simplifier (before)
     85 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
     86 ## CHECK-DAG:     <<Const0:i\d+>>   IntConstant 0
     87 ## CHECK-DAG:     <<Cond:z\d+>>     Equal [<<Const0>>,<<Arg>>]
     88 ## CHECK-DAG:                       If [<<Cond>>]
     89 
     90 ## CHECK-START: int SmaliTests.EqualFalseLhs(boolean) instruction_simplifier (after)
     91 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
     92 ## CHECK-DAG:                       If [<<Arg>>]
     93 
     94 .method public static EqualFalseLhs(Z)I
     95   .registers 3
     96 
     97   const v0, 0x0
     98   const v1, 0x3
     99   if-eq v0, p0, :return
    100   const v1, 0x5
    101   :return
    102   return v1
    103 
    104 .end method
    105 
    106 ## CHECK-START: int SmaliTests.NotEqualTrueRhs(boolean) instruction_simplifier (before)
    107 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
    108 ## CHECK-DAG:     <<Const1:i\d+>>   IntConstant 1
    109 ## CHECK-DAG:     <<Cond:z\d+>>     NotEqual [<<Arg>>,<<Const1>>]
    110 ## CHECK-DAG:                       If [<<Cond>>]
    111 
    112 ## CHECK-START: int SmaliTests.NotEqualTrueRhs(boolean) instruction_simplifier (after)
    113 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
    114 ## CHECK-DAG:                       If [<<Arg>>]
    115 
    116 .method public static NotEqualTrueRhs(Z)I
    117   .registers 3
    118 
    119   const v0, 0x1
    120   const v1, 0x3
    121   if-ne p0, v0, :return
    122   const v1, 0x5
    123   :return
    124   return v1
    125 
    126 .end method
    127 
    128 ## CHECK-START: int SmaliTests.NotEqualTrueLhs(boolean) instruction_simplifier (before)
    129 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
    130 ## CHECK-DAG:     <<Const1:i\d+>>   IntConstant 1
    131 ## CHECK-DAG:     <<Cond:z\d+>>     NotEqual [<<Const1>>,<<Arg>>]
    132 ## CHECK-DAG:                       If [<<Cond>>]
    133 
    134 ## CHECK-START: int SmaliTests.NotEqualTrueLhs(boolean) instruction_simplifier (after)
    135 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
    136 ## CHECK-DAG:                       If [<<Arg>>]
    137 
    138 .method public static NotEqualTrueLhs(Z)I
    139   .registers 3
    140 
    141   const v0, 0x1
    142   const v1, 0x3
    143   if-ne v0, p0, :return
    144   const v1, 0x5
    145   :return
    146   return v1
    147 
    148 .end method
    149 
    150 ## CHECK-START: int SmaliTests.NotEqualFalseRhs(boolean) instruction_simplifier (before)
    151 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
    152 ## CHECK-DAG:     <<Const0:i\d+>>   IntConstant 0
    153 ## CHECK-DAG:     <<Cond:z\d+>>     NotEqual [<<Arg>>,<<Const0>>]
    154 ## CHECK-DAG:                       If [<<Cond>>]
    155 
    156 ## CHECK-START: int SmaliTests.NotEqualFalseRhs(boolean) instruction_simplifier (after)
    157 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
    158 ## CHECK-DAG:                       If [<<Arg>>]
    159 
    160 .method public static NotEqualFalseRhs(Z)I
    161   .registers 3
    162 
    163   const v0, 0x0
    164   const v1, 0x5
    165   if-ne p0, v0, :return
    166   const v1, 0x3
    167   :return
    168   return v1
    169 
    170 .end method
    171 
    172 ## CHECK-START: int SmaliTests.NotEqualFalseLhs(boolean) instruction_simplifier (before)
    173 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
    174 ## CHECK-DAG:     <<Const0:i\d+>>   IntConstant 0
    175 ## CHECK-DAG:     <<Cond:z\d+>>     NotEqual [<<Const0>>,<<Arg>>]
    176 ## CHECK-DAG:                       If [<<Cond>>]
    177 
    178 ## CHECK-START: int SmaliTests.NotEqualFalseLhs(boolean) instruction_simplifier (after)
    179 ## CHECK-DAG:     <<Arg:z\d+>>      ParameterValue
    180 ## CHECK-DAG:                       If [<<Arg>>]
    181 
    182 .method public static NotEqualFalseLhs(Z)I
    183   .registers 3
    184 
    185   const v0, 0x0
    186   const v1, 0x5
    187   if-ne v0, p0, :return
    188   const v1, 0x3
    189   :return
    190   return v1
    191 
    192 .end method
    193 
    194