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 ## CHECK-START: boolean TestCase.testCase() load_store_elimination (after)
     20 ## CHECK-DAG:     If [{{b\d+}}]
     21 
     22 .method public static testCase()Z
     23     .registers 6
     24 
     25     sget-boolean v0, LMain;->field0:Z
     26     sget-boolean v1, LMain;->field1:Z
     27     or-int v2, v0, v1
     28     int-to-byte v2, v2
     29     sput-boolean v2, LMain;->field2:Z
     30 
     31     # LSE will replace this sget with the type conversion above...
     32     sget-boolean v2, LMain;->field2:Z
     33 
     34     # ... and generate an If with a byte-typed condition.
     35     if-eqz v2, :else
     36     const v0, 0x1
     37     return v0
     38 
     39     :else
     40     const v0, 0x0
     41     return v0
     42 .end method
     43