Skip to content

Commit

Permalink
Adjust test for x86-32 and AArch64.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav92003 committed Nov 19, 2023
1 parent 1e2a411 commit c82ee51
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion clients/drcachesim/tests/raw2trace_unit_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2754,7 +2754,7 @@ test_ifiltered(void *drcontext)
instr_t *jcc =
XINST_CREATE_jump_cond(drcontext, DR_PRED_EQ, opnd_create_instr(move1));
// Control flow in the test assumes that memaddr stores address to jcc.
instr_t *jmp = XINST_CREATE_jump_mem(drcontext, OPND_CREATE_MEMPTR(REG1, 0x123));
instr_t *jmp = XINST_CREATE_jump_reg(drcontext, OPND_CREATE_MEMPTR(REG1));
instr_t *move3 =
XINST_CREATE_move(drcontext, opnd_create_reg(REG1), opnd_create_reg(REG2));
instrlist_append(ilist, nop);
Expand Down Expand Up @@ -2826,6 +2826,10 @@ test_ifiltered(void *drcontext)
check_entry(entries, idx, TRACE_TYPE_INSTR_INDIRECT_JUMP, 0) &&
check_entry(entries, idx, TRACE_TYPE_READ, -1) &&
// jcc
#ifdef X86_32
// An extra encoding entry is needed.
check_entry(entries, idx, TRACE_TYPE_ENCODING, -1) &&
#endif
check_entry(entries, idx, TRACE_TYPE_ENCODING, -1) &&
// Since we cannot infer branch targets accurately for i-filtered traces, this
// has the generic conditional jump type (instead of the more specific
Expand All @@ -2837,6 +2841,10 @@ test_ifiltered(void *drcontext)
// jmp
// This has an encoding because the previous dynamic instance was actually
// i-filtered.
#ifdef X86_32
// An extra encoding entry is needed.
check_entry(entries, idx, TRACE_TYPE_ENCODING, -1) &&
#endif
check_entry(entries, idx, TRACE_TYPE_ENCODING, -1) &&
// i-filtered instrs have separate pc entries: one for the instr itself which
// has the instr length, and another for the memref which has a zero size.
Expand Down

0 comments on commit c82ee51

Please sign in to comment.