From e1ac89f2a2e4cfd2e31eac41575f318d3e0f74be Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sun, 30 Aug 2009 16:12:41 +0000 Subject: Add test suite for determine_slotting.c git-svn-id: svn://mattst88.com/svn/annotator/trunk@6 b9d43f0c-d947-41e4-9d27-581b740e5c48 --- src/alpha-dis.c | 2 +- src/determine_slotting.c | 77 ------------------------------------------------ 2 files changed, 1 insertion(+), 78 deletions(-) (limited to 'src') diff --git a/src/alpha-dis.c b/src/alpha-dis.c index 8b7a6fa..72e70e4 100644 --- a/src/alpha-dis.c +++ b/src/alpha-dis.c @@ -109,7 +109,7 @@ print_insn_alpha (memaddr, info) (*info->memory_error_func) (status, memaddr, info); return -1; } - insn = bfd_getl32 (buffer); + memcpy(&insn, buffer, 4); } /* Get the major opcode of the instruction. */ diff --git a/src/determine_slotting.c b/src/determine_slotting.c index 32d6927..d79162b 100644 --- a/src/determine_slotting.c +++ b/src/determine_slotting.c @@ -7,62 +7,6 @@ #define CLUSTER_0 0 #define CLUSTER_1 1 -#if defined DEBUG && DEBUG == 1 - -#include - -#define PRINT_DEBUG printf("%c%c%c%c\n", octaword.instr[3].slot, octaword.instr[2].slot, octaword.instr[1].slot, octaword.instr[0].slot) - -#define RULE1() \ - octaword.instr[3].slot = 'U'; \ - octaword.instr[2].slot = 'U'; \ - octaword.instr[1].slot = 'U'; \ - octaword.instr[0].slot = 'U' - -#define RULE2() \ - octaword.instr[3].slot = 'E'; \ - octaword.instr[2].slot = 'U'; \ - octaword.instr[1].slot = 'U'; \ - octaword.instr[0].slot = 'U' - -#define RULE3() \ - octaword.instr[3].slot = 'U'; \ - octaword.instr[2].slot = 'U'; \ - octaword.instr[1].slot = 'E'; \ - octaword.instr[0].slot = 'L' - -#define RULE3B() \ - octaword.instr[3].slot = 'E'; \ - octaword.instr[2].slot = 'E'; \ - octaword.instr[1].slot = 'L'; \ - octaword.instr[0].slot = 'L' - -#define RULE4C() \ - octaword.instr[3].slot = 'E'; \ - octaword.instr[2].slot = 'E'; \ - octaword.instr[1].slot = 'E'; \ - octaword.instr[0].slot = 'U' - -#define RULE4A() \ - octaword.instr[3].slot = 'E'; \ - octaword.instr[2].slot = 'L'; \ - octaword.instr[1].slot = 'E'; \ - octaword.instr[0].slot = 'U' - -#define RULE4AD() \ - octaword.instr[3].slot = 'U'; \ - octaword.instr[2].slot = 'L'; \ - octaword.instr[1].slot = 'E'; \ - octaword.instr[0].slot = 'E' - -#define RULE4CD() \ - octaword.instr[3].slot = 'E'; \ - octaword.instr[2].slot = 'E'; \ - octaword.instr[1].slot = 'E'; \ - octaword.instr[0].slot = 'E' - -#endif /* DEBUG */ - struct octaword_t { struct { @@ -236,24 +180,3 @@ determine_slotting(struct octaword_t octaword) return octaword; } - -#if defined DEBUG && DEBUG == 1 -int main() { - struct octaword_t octaword; - -// RULE3(); -// RULE3B(); -// RULE4C(); - RULE4A(); -// RULE4AD(); -// RULE4CD(); - - PRINT_DEBUG; - - octaword = determine_slotting(octaword); - - PRINT_DEBUG; - - return 0; -} -#endif -- cgit v1.2.3