xbyak/test/nm_frame.cpp

40 lines
809 B
C++
Raw Normal View History

2010-04-16 01:33:04 +00:00
#include <stdio.h>
2016-08-03 04:19:02 +00:00
#define XBYAK_ENABLE_OMITTED_OPERAND
2010-04-16 01:33:04 +00:00
#include "xbyak/xbyak.h"
2020-02-26 06:24:47 +00:00
#define CYBOZU_TEST_DISABLE_AUTO_RUN
#include "cybozu/test.hpp"
2010-04-16 01:33:04 +00:00
using namespace Xbyak;
2015-08-18 02:55:10 +00:00
#ifdef _MSC_VER
#pragma warning(disable : 4245)
2017-08-22 06:53:34 +00:00
#pragma warning(disable : 4312)
2015-08-18 02:55:10 +00:00
#endif
2010-04-16 01:33:04 +00:00
class Sample : public CodeGenerator {
void operator=(const Sample&);
public:
#include "nm.cpp"
};
class ErrorSample : public CodeGenerator {
void operator=(const ErrorSample&);
public:
void gen()
{
2020-02-26 06:24:47 +00:00
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);
2010-04-16 01:33:04 +00:00
}
};
2020-02-26 06:24:47 +00:00
2010-04-16 01:33:04 +00:00
int main()
{
2020-02-26 06:24:47 +00:00
CYBOZU_TEST_EQUAL(sizeof(Xbyak::Operand), 4u);
Sample s;
s.gen();
2010-04-16 01:33:04 +00:00
ErrorSample es;
es.gen();
}