Mercurial > projects > dstress
comparison run/mini/asm6.d @ 1628:c6ef09dfba4d
add mini test set from ldc project
author | Moritz Warning <moritzwarning@web.de> |
---|---|
date | Mon, 10 Jan 2011 19:47:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1627:e1b954780837 | 1628:c6ef09dfba4d |
---|---|
1 extern(C) int printf(char*, ...); | |
2 | |
3 version (D_InlineAsm_X86) | |
4 version = InlineAsm_X86_Any; | |
5 version (D_InlineAsm_X86_64) | |
6 version = InlineAsm_X86_Any; | |
7 | |
8 void main() | |
9 { | |
10 int a,b,c; | |
11 a = int.max-1; | |
12 b = 5; | |
13 version (InlineAsm_X86_Any) | |
14 { | |
15 asm | |
16 { | |
17 mov EAX, a; | |
18 mov ECX, b; | |
19 add EAX, ECX; | |
20 jo Loverflow; | |
21 mov c, EAX; | |
22 } | |
23 } | |
24 printf("a == %d\n", a); | |
25 printf("b == %d\n", b); | |
26 printf("c == %d\n", c); | |
27 assert(c == c); | |
28 return; | |
29 | |
30 Loverflow: | |
31 int y=0; | |
32 //assert(0, "overflow"); | |
33 } |