view run/a/asm_offset_01_A.d @ 1319:81222734adf3

sed'ed replacement of new:...http.d.puremagic.co... with http://d.puremagic.com/issues/show_bug.cgi?...
author thomask
date Sun, 31 Dec 2006 19:58:06 +0000
parents 236f0d02b8b9
children 596115f20776
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	<lugaidster@gmail.com>
// @date@	2006-04-28
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=116

module dstress.run.a.asm_offset_01_A;

version(D_InlineAsm_X86){
	version = runTest;
}else version(D_InlineAsm_X86_64){
	version = runTest;
}

version(runTest){
	byte b;

	int main(){
		void* x = &b;
		void* y;

		static if(size_t.sizeof == 4){
			asm{
				mov EAX, offset b;
				mov y, EAX;
			}
		}else{
			pragma(msg, "DSTRESS{ERROR}: unsupported pointer size");
			static assert(0);
		}

		if(x != y){
			assert(0);
		}

		return 0;
	}
}else{
	pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
	static assert(0);
}