File: nm_frame.cpp

package info (click to toggle)
xbyak 7.24.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,068 kB
  • sloc: cpp: 21,493; ansic: 2,981; python: 372; makefile: 306; sh: 204
file content (46 lines) | stat: -rw-r--r-- 969 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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;
}