comparison run/a/asm_fdiv_01_D2.d @ 1606:ebff718ff18b

Fix tests from #3. Thanks Don!
author Christian Kamm <kamm incasoftware de>
date Mon, 13 Apr 2009 13:47:03 +0200
parents run/a/asm_fdiv_01_D.d@1c8652b3795a
children
comparison
equal deleted inserted replaced
1605:392a442e2d64 1606:ebff718ff18b
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 module dstress.run.a.asm_fdiv_01_D2;
6
7 version(D_InlineAsm_X86){
8 version = runTest;
9 }else version(D_InlineAsm_X86_64){
10 version = runTest;
11 }
12
13 version(runTest){
14 import addon.cpuinfo;
15
16 int main(){
17 haveFPU!()();
18
19 float a = -3.0f;
20 float b = 12.0f;
21 float c;
22
23 asm{
24 fld a;
25 fld b;
26 fdiv ST,ST(1);
27 fstp c;
28 }
29
30 if(c != -4.0f){
31 assert(0);
32 }
33
34 asm{
35 fld a;
36 fld b;
37 fdiv ST(1),ST;
38 fstp c;
39 fstp c;
40 }
41
42 if(c != a/b){
43 assert(0);
44 }
45
46 return 0;
47 }
48 }else{
49 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
50 static assert(0);
51 }