| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can be | |
| 4 * found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 /* | |
| 8 * Instruction decoding testing for each defined ARM (32-bit) instruction. | |
| 9 * | |
| 10 * All instructions are based on "ARM Architecture Reference Manual | |
| 11 * ARM*v7-A and ARM*v7-R edition, Errata markup". | |
| 12 * | |
| 13 * Instructions are identifier using an ID of the form: | |
| 14 * | |
| 15 * OP_SECTION_FORM_PAGE | |
| 16 * | |
| 17 * where: | |
| 18 * OP = The name of the operator. | |
| 19 * SECTION is the section that defines the instruction. | |
| 20 * FORM is which form on that page (i.e. A1, A2, ...), | |
| 21 * PAGE is the manual page the instruction is defined on. | |
| 22 * | |
| 23 * Classes that implement sanity tests for an instruction is named using the | |
| 24 * instruction ID (see above) followed by the suffix _Tester. The corresponding | |
| 25 * test function is named using the instruction ID (unless there are problems, | |
| 26 * in which case the ID is prefixed with DISABLED_). | |
| 27 */ | |
| 28 | |
| 29 #include "gtest/gtest.h" | |
| 30 #include "native_client/src/trusted/validator_arm/inst_classes_testers.h" | |
| 31 | |
| 32 namespace { | |
| 33 | |
| 34 #ifdef __BIG_ENDIAN__ | |
| 35 #error This test will only succeed on a little-endian machine. Sorry. | |
| 36 #endif | |
| 37 | |
| 38 // Defines a gtest testing harness for testing Arm32 instructions. | |
| 39 class Arm32InstructionTests : public ::testing::Test { | |
| 40 protected: | |
| 41 Arm32InstructionTests() {} | |
| 42 }; | |
| 43 | |
| 44 // *************************************************************************** | |
| 45 // Add (register-shifted register): | |
| 46 // | |
| 47 // ADD(S)<c> <Rd>, <Rn>, <Rm>, <type> <Rs> | |
| 48 // +--------+--------------+--+--------+--------+--------+--+----+--+--------+ | |
| 49 // |31302928|27262524232221|20|19181716|15141312|1110 9 8| 7| 6 5| 4| 3 2 1 0| | |
| 50 // +--------+--------------+--+--------+--------+--------+--+----+--+--------+ | |
| 51 // | cond | 0 0 0 0 1 0 0| S| Rn | Rd | Rs | 0|type| 1| Rm | | |
| 52 // +--------+--------------+--+--------+--------+--------+--+----+--+--------+ | |
| 53 // *************************************************************************** | |
| 54 TEST_F(Arm32InstructionTests, Add_A8_6_7_A1_A8_26) { | |
| 55 nacl_arm_test::Binary4RegisterShiftedOpTester tester; | |
| 56 tester.Test("cccc0000100snnnnddddssss0tt1mmmm"); | |
| 57 } | |
| 58 | |
| 59 } // namespace | |
| 60 | |
| 61 // Test driver function. | |
| 62 int main(int argc, char *argv[]) { | |
| 63 testing::InitGoogleTest(&argc, argv); | |
| 64 return RUN_ALL_TESTS(); | |
| 65 } | |
| OLD | NEW |