Home | History | Annotate | Download | only in d
      1 ; Copyright (C) 2008 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 .source TestStubs.java
     16 .interface public dot.junit.opcodes.instance_of.d.T_instance_of_2.SuperInterface
     17 
     18 .source TestStubs.java
     19 .interface public dot.junit.opcodes.instance_of.d.T_instance_of_2.SuperInterface2
     20 
     21 .source TestStubs.java
     22 .class public dot.junit.opcodes.instance_of.d.T_instance_of_2.SuperClass
     23 .super java/lang/Object
     24 .implements dot/junit/opcodes/instance_of/d/T_instance_of_2/SuperInterface
     25 
     26 .method public <init>()V
     27 .limit regs 1
     28 
     29        invoke-direct {v0}, java/lang/Object/<init>()V
     30        return-void
     31 .end method
     32 
     33 .source TestStubs.java
     34 .class public dot.junit.opcodes.instance_of.d.T_instance_of_2.SubClass
     35 .super dot/junit/opcodes/instance_of/d/T_instance_of_2/SuperClass
     36 
     37 .method public <init>()V
     38 .limit regs 1
     39 
     40        invoke-direct {v0}, dot/junit/opcodes/instance_of/d/T_instance_of_2/SuperClass/<init>()V
     41        return-void
     42 .end method
     43 
     44 
     45 .source T_instance_of_2.java
     46 .class public dot.junit.opcodes.instance_of.d.T_instance_of_2
     47 .super java/lang/Object
     48 
     49 
     50 .method public <init>()V
     51 .limit regs 1
     52 
     53        invoke-direct {v0}, java/lang/Object/<init>()V
     54        return-void
     55 .end method
     56 
     57 .method public run()Z
     58 .limit regs 20
     59 
     60     const v0, 0
     61 
     62 ; (SubClass instanceof SuperClass)
     63     new-instance v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass
     64     invoke-direct {v10}, dot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass/<init>()V
     65     instance-of v15, v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SuperClass
     66     if-eqz v15, LabelExit
     67 
     68 ; (SubClass[] instanceof SuperClass[])
     69     const v11, 1
     70     new-array v10, v11, [Ldot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass;
     71     instance-of v15, v10, [Ldot/junit/opcodes/instance_of/d/T_instance_of_2/SuperClass;
     72     if-eqz v15, LabelExit
     73 
     74 ; (SubClass[] instanceof Object)
     75     new-array v10, v11, [Ldot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass;
     76     instance-of v15, v10, java/lang/Object
     77     if-eqz v15, LabelExit
     78 
     79 ; (SubClass instanceof SuperInterface)
     80     new-instance v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass
     81     invoke-direct {v10}, dot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass/<init>()V
     82     instance-of v15, v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SuperInterface
     83     if-eqz v15, LabelExit
     84 
     85 ; !(SuperClass instanceof SubClass)
     86     new-instance v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SuperClass
     87     invoke-direct {v10}, dot/junit/opcodes/instance_of/d/T_instance_of_2/SuperClass/<init>()V
     88     instance-of v15, v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass
     89     if-nez v15, LabelExit
     90 
     91 ; !(SubClass instanceof SuperInterface2)
     92     new-instance v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass
     93     invoke-direct {v10}, dot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass/<init>()V
     94     instance-of v15, v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SuperInterface2
     95     if-nez v15, LabelExit
     96 
     97 ; !(SubClass[] instanceof SuperInterface)
     98     new-array v10, v11, [Ldot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass;
     99     instance-of v15, v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SuperInterface
    100     if-nez v15, LabelExit
    101 
    102 ; !(SubClass[] instanceof SubClass)
    103     new-array v10, v11, [Ldot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass;
    104     instance-of v15, v10, dot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass
    105     if-nez v15, LabelExit
    106 
    107 ; !(SuperClass[] instanceof SubClass[])
    108     new-array v10, v11, [Ldot/junit/opcodes/instance_of/d/T_instance_of_2/SuperClass;
    109     instance-of v15, v10, [Ldot/junit/opcodes/instance_of/d/T_instance_of_2/SubClass;
    110     if-nez v15, LabelExit
    111 
    112     const v0, 1
    113 
    114 LabelExit:
    115     return v0
    116 
    117 .end method
    118 
    119 
    120