view run/a/asm_fiadd_01_B.d @ 958:80e1b85295b3

DMD-0.154 review
author thomask
date Thu, 13 Apr 2006 07:34:32 +0000
parents 7b2c5a101190
children a468938b0160
line wrap: on
line source

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

module dstress.run.a.asm_fiaddp_01_B;

int main(){
	version(D_InlineAsm){
		double a = -1.2L;
		short b = 34;
		
		asm{
			finit;
			fld a;
			fiadd b;
			fst a;
		}
		
		if(a <= 0){
			assert(0);
		}
		
		a -= 32.8L;
		
		a = (a>0) ? a : -a;
		
		if(a >= a.epsilon*16){
			assert(0);
		}
		
		return 0;
	}else{
		pragma(msg, "no Inline asm support");
		static assert(0);
	}
}