- beginning = start_block();
- emit_movimm(DRC_TEST_VAL,0); // test
- emit_jmpreg(14);
- literal_pool(0);
- end_block(beginning);
- SysPrintf("testing if we can run recompiled code..\n");
- ret = testfunc();
- if (ret == DRC_TEST_VAL)
+ SysPrintf("testing if we can run recompiled code...\n");
+ ((volatile u_int *)out)[0]++; // make cache dirty
+
+ for (i = 0; i < ARRAY_SIZE(ret); i++) {
+ out = translation_cache;
+ beginning = start_block();
+ emit_movimm(DRC_TEST_VAL + i, 0); // test
+ emit_ret();
+ literal_pool(0);
+ end_block(beginning);
+ testfunc = beginning;
+ ret[i] = testfunc();
+ }
+
+ if (ret[0] == DRC_TEST_VAL && ret[1] == DRC_TEST_VAL + 1)