aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test-td-simple.c (renamed from test/test-tdarm-simple.c)20
1 files changed, 13 insertions, 7 deletions
diff --git a/test/test-tdarm-simple.c b/test/test-td-simple.c
index 7211e9b..9844fbd 100644
--- a/test/test-tdarm-simple.c
+++ b/test/test-td-simple.c
@@ -13,7 +13,7 @@ typedef struct tc {
} *tdis_ctx;
#define P(x) P_##x
-NOINLINE
+NOINLINE UNUSED
static tdis_ret P_data(struct tc *ctx, unsigned o0, unsigned o1, unsigned o2, unsigned o3, unsigned out_mask) {
printf("data: %08x\n", ctx->op);
unsigned os[] = {o0, o1, o2, o3};
@@ -27,37 +27,43 @@ static tdis_ret P_data(struct tc *ctx, unsigned o0, unsigned o1, unsigned o2, un
return (tdis_ret) {true};
}
-NOINLINE
+NOINLINE UNUSED
static tdis_ret P_pcrel(struct tc *ctx, UNUSED uint32_t dpc, UNUSED unsigned reg, UNUSED bool is_load) {
printf("adr: %08x\n", ctx->op);
return (tdis_ret) {false};
}
-NOINLINE
+NOINLINE UNUSED
static tdis_ret P_ret(struct tc *ctx) {
printf("ret: %08x\n", ctx->op);
return (tdis_ret) {false};
}
-NOINLINE
+NOINLINE UNUSED
static tdis_ret P_branch(struct tc *ctx, UNUSED uint32_t dpc) {
printf("branch: %08x\n", ctx->op);
return (tdis_ret) {false};
}
-NOINLINE
+NOINLINE UNUSED
static tdis_ret P_unidentified(struct tc *ctx) {
printf("unidentified: %08x\n", ctx->op);
return (tdis_ret) {false};
+}
+NOINLINE UNUSED
+static tdis_ret P_bad(struct tc *ctx) {
+ printf("bad: %08x\n", ctx->op);
+ return (tdis_ret) {false};
}
-#include "dis-arm.inc.h"
+
+#include HDR
int main(UNUSED int argc, char **argv) {
struct tc ctx;
ctx.pc = 0xdead0000;
ctx.op = (uint32_t) strtoll(argv[1] ? argv[1] : "deadbeef", NULL, 16);
- P_dis_arm(&ctx);
+ PDIS(&ctx);
printf("==> %x\n", ctx.newop);
}