Skip to content

Commit ab27539

Browse files
Better AArch64 Test Runner (#475)
* More detailed AArch64 test runner
1 parent 4ab86f3 commit ab27539

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

tests/AArch64/Run.cpp

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,6 @@ static void RunWithFlags(const test::TestInfo *info, NZCV flags,
436436
native_state->hyper_call = AsyncHyperCall::kInvalid;
437437
lifted_state->hyper_call = AsyncHyperCall::kInvalid;
438438

439-
EXPECT_TRUE(lifted_state->sr.n == native_state->sr.n);
440-
EXPECT_TRUE(lifted_state->sr.z == native_state->sr.z);
441-
EXPECT_TRUE(lifted_state->sr.c == native_state->sr.c);
442-
EXPECT_TRUE(lifted_state->sr.v == native_state->sr.v);
443439
EXPECT_TRUE(lifted_state->gpr == native_state->gpr);
444440

445441
// The lifted code won't update these.
@@ -453,6 +449,59 @@ static void RunWithFlags(const test::TestInfo *info, NZCV flags,
453449
if (gLiftedState != gNativeState) {
454450
LOG(ERROR) << "States did not match for " << desc;
455451
EXPECT_TRUE(!"Lifted and native states did not match.");
452+
453+
#define DIFF(name, a) EXPECT_EQ(lifted_state->a, native_state->a)
454+
455+
DIFF(X0, gpr.x0.qword);
456+
DIFF(X1, gpr.x1.qword);
457+
DIFF(X2, gpr.x2.qword);
458+
DIFF(X3, gpr.x3.qword);
459+
DIFF(X4, gpr.x4.qword);
460+
DIFF(X5, gpr.x5.qword);
461+
DIFF(X6, gpr.x6.qword);
462+
DIFF(X7, gpr.x7.qword);
463+
DIFF(X8, gpr.x8.qword);
464+
DIFF(X9, gpr.x9.qword);
465+
DIFF(X10, gpr.x10.qword);
466+
DIFF(X11, gpr.x11.qword);
467+
DIFF(X12, gpr.x12.qword);
468+
DIFF(X13, gpr.x13.qword);
469+
DIFF(X14, gpr.x14.qword);
470+
DIFF(X15, gpr.x15.qword);
471+
DIFF(X16, gpr.x16.qword);
472+
DIFF(X17, gpr.x17.qword);
473+
DIFF(X18, gpr.x18.qword);
474+
DIFF(X19, gpr.x19.qword);
475+
DIFF(X20, gpr.x20.qword);
476+
DIFF(X21, gpr.x21.qword);
477+
DIFF(X22, gpr.x22.qword);
478+
DIFF(X23, gpr.x23.qword);
479+
DIFF(X24, gpr.x24.qword);
480+
DIFF(X25, gpr.x25.qword);
481+
DIFF(X26, gpr.x26.qword);
482+
DIFF(X27, gpr.x27.qword);
483+
DIFF(X28, gpr.x28.qword);
484+
DIFF(X29, gpr.x29.qword);
485+
DIFF(X30, gpr.x30.qword);
486+
487+
DIFF(IXC, sr.ixc);
488+
DIFF(OFC, sr.ofc);
489+
DIFF(UFC, sr.ufc);
490+
DIFF(IDC, sr.idc);
491+
DIFF(IOC, sr.ioc);
492+
493+
DIFF(N, sr.n);
494+
DIFF(Z, sr.z);
495+
DIFF(C, sr.c);
496+
DIFF(V, sr.v);
497+
498+
auto lifted_state_bytes = reinterpret_cast<uint8_t *>(lifted_state);
499+
auto native_state_bytes = reinterpret_cast<uint8_t *>(native_state);
500+
501+
for (size_t i = 0; i < sizeof(State); ++i) {
502+
LOG_IF(ERROR, lifted_state_bytes[i] != native_state_bytes[i])
503+
<< "Bytes at offset " << i << " are different";
504+
}
456505
}
457506

458507
if (gLiftedStack != gNativeStack) {

0 commit comments

Comments
 (0)