Skip to content

Commit

Permalink
add tests of ctestscc
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Nov 29, 2023
1 parent 45711c5 commit a4ec97c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/apx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1558,9 +1558,28 @@ CYBOZU_TEST_AUTO(ctestb)
ctestb(word [r30], 0x1234, 13);
ctestb(dword [r30], 0x12345678, 14);
ctestb(qword [r30], 0x12345678, 15);

// all
ctesto(rax, rcx, 0);
ctestno(rax, rcx, 1);
ctestb(rax, rcx, 2);
ctestnb(rax, rcx, 3);
ctestz(rax, rcx, 4);
ctestnz(rax, rcx, 5);
ctestbe(rax, rcx, 6);
ctestnbe(rax, rcx, 7);
ctests(rax, rcx, 8);
ctestns(rax, rcx, 9);
ctestt(rax, rcx, 10);
ctestf(rax, rcx, 11);
ctestl(rax, rcx, 12);
ctestnl(rax, rcx, 13);
ctestle(rax, rcx, 14);
ctestnle(rax, rcx, 15);
}
} c;
const uint8_t tbl[] = {
// ctestb
0x62, 0x4c, 0x04, 0x02, 0x84, 0xfe, 0x62, 0x4c, 0x0d, 0x02, 0x85, 0xfe, 0x62, 0x4c, 0x14, 0x02,
0x85, 0xfe, 0x62, 0x4c, 0x9c, 0x02, 0x85, 0xfe, 0x62, 0x4c, 0x24, 0x02, 0x84, 0x3e, 0x62, 0x4c,
0x2d, 0x02, 0x85, 0x3e, 0x62, 0x4c, 0x34, 0x02, 0x85, 0x3e, 0x62, 0x4c, 0xbc, 0x02, 0x85, 0x3e,
Expand All @@ -1569,6 +1588,13 @@ CYBOZU_TEST_AUTO(ctestb)
0x56, 0x34, 0x12, 0x62, 0xdc, 0x64, 0x02, 0xf6, 0x06, 0x12, 0x62, 0xdc, 0x6d, 0x02, 0xf7, 0x06,
0x34, 0x12, 0x62, 0xdc, 0x74, 0x02, 0xf7, 0x06, 0x78, 0x56, 0x34, 0x12, 0x62, 0xdc, 0xfc, 0x02,
0xf7, 0x06, 0x78, 0x56, 0x34, 0x12,
// all
0x62, 0xf4, 0x84, 0x00, 0x85, 0xc8, 0x62, 0xf4, 0x8c, 0x01, 0x85, 0xc8, 0x62, 0xf4, 0x94, 0x02,
0x85, 0xc8, 0x62, 0xf4, 0x9c, 0x03, 0x85, 0xc8, 0x62, 0xf4, 0xa4, 0x04, 0x85, 0xc8, 0x62, 0xf4,
0xac, 0x05, 0x85, 0xc8, 0x62, 0xf4, 0xb4, 0x06, 0x85, 0xc8, 0x62, 0xf4, 0xbc, 0x07, 0x85, 0xc8,
0x62, 0xf4, 0xc4, 0x08, 0x85, 0xc8, 0x62, 0xf4, 0xcc, 0x09, 0x85, 0xc8, 0x62, 0xf4, 0xd4, 0x0a,
0x85, 0xc8, 0x62, 0xf4, 0xdc, 0x0b, 0x85, 0xc8, 0x62, 0xf4, 0xe4, 0x0c, 0x85, 0xc8, 0x62, 0xf4,
0xec, 0x0d, 0x85, 0xc8, 0x62, 0xf4, 0xf4, 0x0e, 0x85, 0xc8, 0x62, 0xf4, 0xfc, 0x0f, 0x85, 0xc8,
};
const size_t n = sizeof(tbl);
CYBOZU_TEST_EQUAL(c.getSize(), n);
Expand Down

0 comments on commit a4ec97c

Please sign in to comment.