summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asmjit/test/asmjit_test_assembler.h
diff options
context:
space:
mode:
author Patrick Mackinlay <pmackinlay@hotmail.com>2024-04-11 00:16:51 +0700
committer GitHub <noreply@github.com>2024-04-11 03:16:51 +1000
commit2c566627a1fc0ab21cc0399e8ad0ce134e36b53f (patch)
tree8eb19fad727675c673de8e59a7fd6137e14f2cfd /3rdparty/asmjit/test/asmjit_test_assembler.h
parent4bcbfac11f352eabcae33b203c026ce02b3fd4ba (diff)
3rdparty/asmjit: Updated to upstream version 1.13.0. (#12228)
From revision asmjit/asmjit@e5d7c0bd5d9aec44d68830187138149e6a8c4e32
Diffstat (limited to '3rdparty/asmjit/test/asmjit_test_assembler.h')
-rw-r--r--3rdparty/asmjit/test/asmjit_test_assembler.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/3rdparty/asmjit/test/asmjit_test_assembler.h b/3rdparty/asmjit/test/asmjit_test_assembler.h
index 61d774bbb1d..26f2c97ed98 100644
--- a/3rdparty/asmjit/test/asmjit_test_assembler.h
+++ b/3rdparty/asmjit/test/asmjit_test_assembler.h
@@ -10,7 +10,7 @@
#include <stdio.h>
struct TestSettings {
- bool quiet;
+ bool verbose;
bool validate;
};
@@ -52,7 +52,7 @@ public:
assembler.addDiagnosticOptions(asmjit::DiagnosticOptions::kValidateAssembler);
}
- ASMJIT_NOINLINE bool testInstruction(const char* expectedOpcode, const char* s, uint32_t err) noexcept {
+ ASMJIT_NOINLINE bool testValidInstruction(const char* s, const char* expectedOpcode, asmjit::Error err = asmjit::kErrorOk) noexcept {
count++;
if (err) {
@@ -73,13 +73,36 @@ public:
return false;
}
- if (!settings.quiet)
+ if (settings.verbose)
printf(" OK [%s] <- %s\n", encodedOpcode.data(), s);
passed++;
prepare();
return true;
}
+
+ ASMJIT_NOINLINE bool testInvalidInstruction(const char* s, asmjit::Error expectedError, asmjit::Error err) noexcept {
+ count++;
+
+ if (err == asmjit::kErrorOk) {
+ printf(" !! %s passed, but should have failed with <%s> error\n", s, asmjit::DebugUtils::errorAsString(expectedError));
+ prepare();
+ return false;
+ }
+
+ if (err != asmjit::kErrorOk) {
+ printf(" !! %s failed with <%s>, but should have failed with <%s>\n", s, asmjit::DebugUtils::errorAsString(err), asmjit::DebugUtils::errorAsString(expectedError));
+ prepare();
+ return false;
+ }
+
+ if (settings.verbose)
+ printf(" OK [%s] <- %s\n", asmjit::DebugUtils::errorAsString(err), s);
+
+ passed++;
+ prepare();
+ return true;
+ }
};
#endif // ASMJIT_TEST_ASSEMBLER_H_INCLUDED