| Index: src/trusted/validator_mips/testdata/test_jmp_reg.S
|
| diff --git a/src/trusted/validator_mips/testdata/test_jmp_reg.S b/src/trusted/validator_mips/testdata/test_jmp_reg.S
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7f6da88baa2fc2c0f49710f81d551d8f633db884
|
| --- /dev/null
|
| +++ b/src/trusted/validator_mips/testdata/test_jmp_reg.S
|
| @@ -0,0 +1,82 @@
|
| +# Copyright 2012 The Native Client Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can
|
| +# be found in the LICENSE file.
|
| +# Copyright 2012 MIPS Technologies / RT-RK.
|
| +
|
| +#
|
| +# Tests for jr & jalr instructions.
|
| +#
|
| +
|
| +.globl _start
|
| +_start:
|
| +.align 4
|
| +.set noreorder
|
| +.set JUMP_MASK,$t6
|
| +
|
| +bundle_8mod16_jr:
|
| + nop
|
| + and $t1,$t1,JUMP_MASK
|
| + jr $t1 #OK
|
| + nop
|
| +
|
| +bundle_4mod16_jr:
|
| + and $t1,$t1,JUMP_MASK
|
| + jr $t1 #OK
|
| + nop
|
| + nop
|
| +
|
| +bundle_8mod16_jalr:
|
| + nop
|
| + and $t1,$t1,JUMP_MASK
|
| + jalr $t1 #OK
|
| + nop
|
| +
|
| +bundle_4mod16_jalr:
|
| + and $t1,$t1,JUMP_MASK
|
| + jalr $t1 #kProblemMisalignedCall
|
| + nop
|
| + and $a1, $a1, $t7
|
| +
|
| +cross_bundle:
|
| + jr $a1 #error, cross bundle
|
| + nop
|
| + nop
|
| + nop
|
| +
|
| +bundle_bad_mask:
|
| + addiu $a0, $zero, 16
|
| + and $a1, $a1, $t7
|
| + jalr $a1 #kProblemJmpRegNoMask
|
| + nop
|
| +
|
| +bundle_no_mask:
|
| + addiu $a0, $zero, 16
|
| + lw $a2, 16($sp)
|
| + jalr $a1 #kProblemJmpRegNoMask
|
| + nop
|
| +
|
| +bundle_jalr_t0_t9:
|
| + addu $s0, $a0, $a1
|
| + and $v0, $v0, JUMP_MASK
|
| + jalr $t0, $v0 # ok
|
| + nop
|
| +
|
| +bundle_jalr_t7_t9:
|
| + addu $s0, $a0, $a1
|
| + and $v0, $v0, JUMP_MASK
|
| + jalr $t7, $v0 #kProblemReadOnlyRegister
|
| + nop
|
| +
|
| +bundle_jalr_t7_t92:
|
| + addu $s0, $a0, $a1
|
| + and $v0, $v0, JUMP_MASK
|
| + jalr $sp, $v0 #error, kProblemUnsafeDataWrite
|
| + nop
|
| +
|
| +bundle_jal_delay_slot:
|
| + b bundle_jalr_t7_t92
|
| + and $v0, $v0, JUMP_MASK
|
| + jalr $t0, $v0 #ok
|
| + nop
|
| +
|
| +end_of_code:
|
|
|