text: #-
  # Copyright (c) 2011 Robert N. M. Watson
  # All rights reserved.
  #
  # This software was developed by SRI International and the University of
  # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
  # ("CTSRD"), as part of the DARPA CRASH research programme.
  #
  # @BERI_LICENSE_HEADER_START@
  #
  # Licensed to BERI Open Systems C.I.C. (BERI) under one or more contributor
  # license agreements.  See the NOTICE file distributed with this work for
  # additional information regarding copyright ownership.  BERI licenses this
  # file to you under the BERI Hardware-Software License, Version 1.0 (the
  # "License"); you may not use this file except in compliance with the
  # License.  You may obtain a copy of the License at:
  #
  #   http://www.beri-open-systems.org/legal/license-1-0.txt
  #
  # Unless required by applicable law or agreed to in writing, Work distributed
  # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  # CONDITIONS OF ANY KIND, either express or implied.  See the License for the
  # specific language governing permissions and limitations under the License.
  #
  # @BERI_LICENSE_HEADER_END@
  #
  
  from beritest_tools import BaseBERITestCase
  
  class test_raw_addiu(BaseBERITestCase):
      def test_independent_inputs(self):
          '''Check that simple add worked, no input modification'''
          self.assertRegisterEqual(self.MIPS.a0, 1, "addiu modified input")
          self.assertRegisterEqual(self.MIPS.a1, 2, "addiu failed")
  
      def test_into_input(self):
          self.assertRegisterEqual(self.MIPS.a2, 2, "addiu into input failed")
  
      def test_pipeline(self):
          self.assertRegisterEqual(self.MIPS.a3, 3, "addiu-to-addiu pipeline failed")
  
      def test_sign_extended_immediate(self):
          self.assertRegisterEqual(self.MIPS.a4, 0, "addiu immediate not signed")
  
      def test_pos_neg_to_zero(self):
          self.assertRegisterEqual(self.MIPS.a5, 0, "positive plus negative to zero failed")
  
      def test_neg_neg_to_neg(self):
          self.assertRegisterEqual(self.MIPS.a6, 0xfffffffffffffffe, "negative plus negative to negative failed")
  
      def test_neg_pos_to_pos(self):
          self.assertRegisterEqual(self.MIPS.a7, 1, "negative plus positive to positive failed")
  
      def test_neg_pos_to_neg(self):
          self.assertRegisterEqual(self.MIPS.s0, 0xffffffffffffffff, "positive plus negative to negative failed")
  