Split assembler tests so they can compile much faster with GCC

This commit is contained in:
kobalicek
2021-03-13 14:28:05 +01:00
parent 8b35b4cffb
commit c9cebc67bc
4 changed files with 9285 additions and 9195 deletions

View File

@@ -510,6 +510,7 @@ if (NOT ASMJIT_EMBED)
asmjit_add_target(asmjit_test_assembler TEST
SOURCES test/asmjit_test_assembler.cpp
test/asmjit_test_assembler_x64.cpp
test/asmjit_test_assembler_x86.cpp
test/asmjit_test_assembler.h
LIBRARIES asmjit::asmjit

View File

@@ -44,7 +44,9 @@ public:
AssemblerTester(uint32_t arch, const TestSettings& settings) noexcept
: env(arch),
settings(settings) {}
settings(settings) {
prepare();
}
void printHeader(const char* archName) noexcept {
printf("%s assembler tests:\n", archName);
@@ -56,17 +58,19 @@ public:
bool didPass() const noexcept { return passed == count; }
void beforeInstruction() noexcept {
void prepare() noexcept {
code.reset();
code.init(env, 0);
code.attach(&assembler);
}
bool testInstruction(const char* expectedOpcode, const char* s, uint32_t err) noexcept {
ASMJIT_NOINLINE bool testInstruction(const char* expectedOpcode, const char* s, uint32_t err) noexcept {
count++;
if (err) {
printf(" !! %s\n"
" <%s>\n", s, asmjit::DebugUtils::errorAsString(err));
prepare();
return false;
}
@@ -77,6 +81,7 @@ public:
if (encodedOpcode != expectedOpcode) {
printf(" !! [%s] <- %s\n"
" [%s] (Expected)\n", encodedOpcode.data(), s, expectedOpcode);
prepare();
return false;
}
@@ -84,13 +89,9 @@ public:
printf(" OK [%s] <- %s\n", encodedOpcode.data(), s);
passed++;
prepare();
return true;
}
void afterInstruction() noexcept {
code.reset();
}
};
#endif // ASMJIT_TEST_ASSEMBLER_H_INCLUDED

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff