Home | History | Annotate | Download | only in move_result_wide
      1 /*
      2  * Copyright (C) 2008 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 package dot.junit.opcodes.move_result_wide;
     18 
     19 import dot.junit.DxTestCase;
     20 import dot.junit.DxUtil;
     21 import dot.junit.opcodes.move_result_wide.d.T_move_result_wide_1;
     22 
     23 public class Test_move_result_wide extends DxTestCase {
     24     /**
     25      * @title tests move-result-wide functionality
     26      */
     27     public void testN1() {
     28         assertTrue(T_move_result_wide_1.run());
     29     }
     30 
     31 
     32     /**
     33      * @constraint A23
     34      * @title  number of registers - dest is not valid
     35      */
     36     public void testVFE1() {
     37         try {
     38             Class.forName("dot.junit.opcodes.move_result_wide.d.T_move_result_wide_2");
     39             fail("expected a verification exception");
     40         } catch (Throwable t) {
     41             DxUtil.checkVerifyException(t);
     42         }
     43     }
     44 
     45 
     46     /**
     47      * @constraint B1
     48      * @title reference
     49      */
     50     public void testVFE2() {
     51         try {
     52             Class.forName("dot.junit.opcodes.move_result_wide.d.T_move_result_wide_3");
     53             fail("expected a verification exception");
     54         } catch (Throwable t) {
     55             DxUtil.checkVerifyException(t);
     56         }
     57     }
     58 
     59     /**
     60      * @constraint B1
     61      * @title  32-bit value
     62      */
     63     public void testVFE3() {
     64         try {
     65             Class.forName("dot.junit.opcodes.move_result_wide.d.T_move_result_wide_4");
     66             fail("expected a verification exception");
     67         } catch (Throwable t) {
     68             DxUtil.checkVerifyException(t);
     69         }
     70     }
     71 
     72 
     73     /**
     74      * @constraint B18
     75      * @title When writing to a register that is one half of a
     76      * register pair, but not touching the other half, the old register pair gets broken
     77      * up, and the other register involved in it becomes undefined.
     78      */
     79     public void testVFE4() {
     80         try {
     81             Class.forName("dot.junit.opcodes.move_result_wide.d.T_move_result_wide_5");
     82             fail("expected a verification exception");
     83         } catch (Throwable t) {
     84             DxUtil.checkVerifyException(t);
     85         }
     86     }
     87 
     88     /**
     89      * @constraint B19
     90      * @title move-result-wide instruction must be immediately preceded
     91      * (in the insns array) by an <invoke-kind> instruction
     92      */
     93     public void testVFE5() {
     94         try {
     95             Class.forName("dot.junit.opcodes.move_result_wide.d.T_move_result_wide_6");
     96             fail("expected a verification exception");
     97         } catch (Throwable t) {
     98             DxUtil.checkVerifyException(t);
     99         }
    100     }
    101 
    102     /**
    103      * @constraint B20
    104      * @title move-result-wide instruction must be immediately preceded
    105      * (in actual control flow) by an <invoke-kind> instruction
    106      */
    107     public void testVFE6() {
    108         try {
    109             Class.forName("dot.junit.opcodes.move_result_wide.d.T_move_result_wide_7");
    110             fail("expected a verification exception");
    111         } catch (Throwable t) {
    112             DxUtil.checkVerifyException(t);
    113         }
    114     }
    115 
    116     /**
    117      * @constraint A24
    118      * @title number of registers
    119      */
    120     public void testVFE7() {
    121         try {
    122             Class.forName("dot.junit.opcodes.move_result_wide.d.T_move_result_wide_8");
    123             fail("expected a verification exception");
    124         } catch (Throwable t) {
    125             DxUtil.checkVerifyException(t);
    126         }
    127     }
    128 
    129 }
    130