diff options
Diffstat (limited to 'externals/biscuit/tests/src/assembler_test_utils.hpp')
-rw-r--r-- | externals/biscuit/tests/src/assembler_test_utils.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/externals/biscuit/tests/src/assembler_test_utils.hpp b/externals/biscuit/tests/src/assembler_test_utils.hpp new file mode 100644 index 00000000..a20737dc --- /dev/null +++ b/externals/biscuit/tests/src/assembler_test_utils.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include <biscuit/assembler.hpp> +#include <cstdint> + +namespace biscuit { + +template <typename T> +inline Assembler MakeAssembler32(T& buffer) { + return Assembler{reinterpret_cast<uint8_t*>(&buffer), sizeof(buffer), ArchFeature::RV32}; +} + +template <typename T> +inline Assembler MakeAssembler64(T& buffer) { + return Assembler{reinterpret_cast<uint8_t*>(&buffer), sizeof(buffer), ArchFeature::RV64}; +} + +template <typename T> +inline Assembler MakeAssembler128(T& buffer) { + return Assembler{reinterpret_cast<uint8_t*>(&buffer), sizeof(buffer), ArchFeature::RV128}; +} + +} // namespace biscuit |