Squashed 'external/xbyak/' content from commit 9d8ff37

git-subtree-dir: external/xbyak
git-subtree-split: 9d8ff37306f39c6a71cf998078cbe880ce5dc224
This commit is contained in:
Simone Coco
2025-12-23 16:51:03 +01:00
commit 0a097849af
148 changed files with 33794 additions and 0 deletions

46
test/nm_frame.cpp Normal file
View File

@@ -0,0 +1,46 @@
#include <stdio.h>
#define XBYAK_ENABLE_OMITTED_OPERAND
#include "xbyak/xbyak.h"
#define CYBOZU_TEST_DISABLE_AUTO_RUN
#include "cybozu/test.hpp"
using namespace Xbyak;
#ifdef _MSC_VER
#pragma warning(disable : 4245)
#pragma warning(disable : 4312)
#endif
class Sample : public CodeGenerator {
void operator=(const Sample&);
public:
#include "nm.cpp"
};
class ErrorSample : public CodeGenerator {
void operator=(const ErrorSample&);
public:
void gen()
{
#ifndef XBYAK_NO_EXCEPTION
CYBOZU_TEST_EXCEPTION(mov(ptr[eax],1), std::exception);
CYBOZU_TEST_EXCEPTION(test(ptr[eax],1), std::exception);
CYBOZU_TEST_EXCEPTION(adc(ptr[eax],1), std::exception);
CYBOZU_TEST_EXCEPTION(setz(eax), std::exception);
#endif
}
};
int main()
try
{
// the size of Operand exceeds 32 bit.
CYBOZU_TEST_EQUAL(sizeof(Xbyak::Operand), 8u);
Sample s;
s.gen();
ErrorSample es;
es.gen();
} catch (std::exception& e) {
fprintf(stderr, "ERR=%s\n", e.what());
return 1;
}