Lines Matching full:check
25 #define check(x) do { \ macro
39 check(instr_is_branch_iform(ppc_inst(0x48000000))); in test_branch_iform()
41 check(instr_is_branch_iform(ppc_inst(0x4bffffff))); in test_branch_iform()
43 check(!instr_is_branch_iform(ppc_inst(0xcbffffff))); in test_branch_iform()
45 check(!instr_is_branch_iform(ppc_inst(0x7bffffff))); in test_branch_iform()
48 check(instr_is_branch_iform(ppc_inst(0x48000001))); in test_branch_iform()
50 check(instr_is_branch_iform(ppc_inst(0x4bfffffd))); in test_branch_iform()
52 check(instr_is_branch_iform(ppc_inst(0x4bff00fd))); in test_branch_iform()
54 check(!instr_is_branch_iform(ppc_inst(0x7bfffffd))); in test_branch_iform()
58 check(instr_is_branch_to_addr(iptr, 0x100)); in test_branch_iform()
61 check(instr_is_branch_to_addr(iptr, 0x420fc)); in test_branch_iform()
64 check(instr_is_branch_to_addr(iptr, addr + 0x1FFFFFC)); in test_branch_iform()
67 check(instr_is_branch_to_addr(iptr, addr - 4)); in test_branch_iform()
70 check(instr_is_branch_to_addr(iptr, addr - 0x2000000)); in test_branch_iform()
75 check(instr_is_branch_to_addr(iptr, addr)); in test_branch_iform()
80 check(instr_is_branch_to_addr(iptr, addr - 0x100)); in test_branch_iform()
85 check(instr_is_branch_to_addr(iptr, addr + 0x100)); in test_branch_iform()
90 check(instr_is_branch_to_addr(iptr, addr - 0x2000000)); in test_branch_iform()
94 check(err); in test_branch_iform()
98 check(err); in test_branch_iform()
102 check(err); in test_branch_iform()
104 /* Check flags are masked correctly */ in test_branch_iform()
107 check(instr_is_branch_to_addr(iptr, addr)); in test_branch_iform()
108 check(ppc_inst_equal(instr, ppc_inst(0x48000000))); in test_branch_iform()
117 /* Check we can create a function call */ in test_create_function_call()
122 check(instr_is_branch_to_addr(iptr, dest)); in test_create_function_call()
137 check(instr_is_branch_bform(ppc_inst(0x40000000))); in test_branch_bform()
139 check(instr_is_branch_bform(ppc_inst(0x43ffffff))); in test_branch_bform()
141 check(!instr_is_branch_bform(ppc_inst(0xc3ffffff))); in test_branch_bform()
143 check(!instr_is_branch_bform(ppc_inst(0x7bffffff))); in test_branch_bform()
147 check(instr_is_branch_to_addr(iptr, 0x100)); in test_branch_bform()
150 check(instr_is_branch_to_addr(iptr, 0x20fc)); in test_branch_bform()
153 check(instr_is_branch_to_addr(iptr, addr + 0x7FFC)); in test_branch_bform()
156 check(instr_is_branch_to_addr(iptr, addr - 4)); in test_branch_bform()
159 check(instr_is_branch_to_addr(iptr, addr - 0x8000)); in test_branch_bform()
167 check(instr_is_branch_to_addr(iptr, addr)); in test_branch_bform()
172 check(instr_is_branch_to_addr(iptr, addr - 0x100)); in test_branch_bform()
177 check(instr_is_branch_to_addr(iptr, addr + 0x100)); in test_branch_bform()
182 check(instr_is_branch_to_addr(iptr, addr - 0x8000)); in test_branch_bform()
186 check(err); in test_branch_bform()
190 check(err); in test_branch_bform()
194 check(err); in test_branch_bform()
196 /* Check flags are masked correctly */ in test_branch_bform()
199 check(instr_is_branch_to_addr(iptr, addr)); in test_branch_bform()
200 check(ppc_inst_equal(instr, ppc_inst(0x43FF0000))); in test_branch_bform()
211 check(buf); in test_translate_branch()
220 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
224 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
234 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
235 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
236 check(ppc_inst_equal(ppc_inst_read(q), ppc_inst(0x4a000000))); in test_translate_branch()
246 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
247 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
248 check(ppc_inst_equal(ppc_inst_read(q), ppc_inst(0x49fffffc))); in test_translate_branch()
258 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
259 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
269 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
270 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
280 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
284 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
294 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
295 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
296 check(ppc_inst_equal(ppc_inst_read(q), ppc_inst(0x43ff8000))); in test_translate_branch()
306 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
307 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
308 check(ppc_inst_equal(ppc_inst_read(q), ppc_inst(0x43ff7ffc))); in test_translate_branch()
318 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
319 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
329 check(instr_is_branch_to_addr(p, addr)); in test_translate_branch()
330 check(instr_is_branch_to_addr(q, addr)); in test_translate_branch()
347 check(!memcmp(iptr, expected, sizeof(expected))); in test_prefixed_patching()