mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-01 12:14:50 +01:00
Merge commit '4ed09fda06' as 'externals/xbyak'
This commit is contained in:
commit
d28498685f
79 changed files with 22734 additions and 0 deletions
51
externals/xbyak/test/nm_frame.cpp
vendored
Normal file
51
externals/xbyak/test/nm_frame.cpp
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#include <stdio.h>
|
||||
#define XBYAK_ENABLE_OMITTED_OPERAND
|
||||
#include "xbyak/xbyak.h"
|
||||
|
||||
using namespace Xbyak;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4245)
|
||||
#endif
|
||||
class Sample : public CodeGenerator {
|
||||
void operator=(const Sample&);
|
||||
public:
|
||||
#include "nm.cpp"
|
||||
};
|
||||
|
||||
#define _STR(x) #x
|
||||
#define TEST(syntax) err = true; try { syntax; err = false; } catch (Xbyak::Error) { } catch (...) { } if (!err) printf("should be err:%s;\n", _STR(syntax))
|
||||
|
||||
class ErrorSample : public CodeGenerator {
|
||||
void operator=(const ErrorSample&);
|
||||
public:
|
||||
void gen()
|
||||
{
|
||||
bool err;
|
||||
TEST(mov(ptr[eax],1));
|
||||
TEST(test(ptr[eax],1));
|
||||
TEST(adc(ptr[eax],1));
|
||||
TEST(setz(eax));
|
||||
}
|
||||
};
|
||||
int main()
|
||||
try
|
||||
{
|
||||
size_t size = sizeof(Xbyak::Operand);
|
||||
if (size != 4) {
|
||||
printf("sizeof Operand %d\n", (int)size);
|
||||
}
|
||||
try {
|
||||
Sample s;
|
||||
s.gen();
|
||||
} catch (std::exception& e) {
|
||||
printf("ERR:%s\n", e.what());
|
||||
} catch (...) {
|
||||
printf("unknown error\n");
|
||||
}
|
||||
ErrorSample es;
|
||||
es.gen();
|
||||
} catch (std::exception& e) {
|
||||
printf("err %s\n", e.what());
|
||||
return 1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue