mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-17 12:34:35 +03:00
AsmJit cleanup and refactoring
This commit is contained in:
@@ -48,7 +48,7 @@ static void makeRawFunc(x86::Emitter* emitter) noexcept {
|
||||
|
||||
// Create and initialize `FuncDetail` and `FuncFrame`.
|
||||
FuncDetail func;
|
||||
func.init(FuncSignatureT<void, int*, const int*, const int*>(CallConv::kIdHost));
|
||||
func.init(FuncSignatureT<void, int*, const int*, const int*>(CallConv::kIdHost), emitter->environment());
|
||||
|
||||
FuncFrame frame;
|
||||
frame.init(func);
|
||||
@@ -101,10 +101,11 @@ static void makeCompiledFunc(x86::Compiler* cc) noexcept {
|
||||
static uint32_t testFunc(JitRuntime& rt, uint32_t emitterType) noexcept {
|
||||
#ifndef ASMJIT_NO_LOGGING
|
||||
FileLogger logger(stdout);
|
||||
logger.setIndentation(FormatOptions::kIndentationCode, 2);
|
||||
#endif
|
||||
|
||||
CodeHolder code;
|
||||
code.init(rt.codeInfo());
|
||||
code.init(rt.environment());
|
||||
|
||||
#ifndef ASMJIT_NO_LOGGING
|
||||
code.setLogger(&logger);
|
||||
@@ -173,8 +174,10 @@ static uint32_t testFunc(JitRuntime& rt, uint32_t emitterType) noexcept {
|
||||
}
|
||||
|
||||
int main() {
|
||||
unsigned nFailed = 0;
|
||||
printf("AsmJit X86 Emitter Test\n\n");
|
||||
|
||||
JitRuntime rt;
|
||||
unsigned nFailed = 0;
|
||||
|
||||
nFailed += testFunc(rt, BaseEmitter::kTypeAssembler);
|
||||
|
||||
@@ -187,9 +190,9 @@ int main() {
|
||||
#endif
|
||||
|
||||
if (!nFailed)
|
||||
printf("[PASSED] All tests passed\n");
|
||||
printf("Success:\n All tests passed\n");
|
||||
else
|
||||
printf("[FAILED] %u %s failed\n", nFailed, nFailed == 1 ? "test" : "tests");
|
||||
printf("Failure:\n %u %s failed\n", nFailed, nFailed == 1 ? "test" : "tests");
|
||||
|
||||
return nFailed ? 1 : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user