Mercurial > projects > dstress
annotate run/t/tuple_19_A.d @ 1605:392a442e2d64
Use tuple value instead of tuple type as asm arg!
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 07 Apr 2009 17:42:12 +0200 |
parents | 10fb8b4eeae3 |
children |
rev | line source |
---|---|
1425 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ Don Clugston <clugdbug@yahoo.com.au> | |
6 // @date@ 2007-03-06 | |
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1028 | |
8 // @desc@ [Issue 1028] Segfault using tuple inside asm code. | |
9 | |
10 module dstress.run.t.tuple_19_A; | |
11 | |
12 version(D_InlineAsm_X86){ | |
13 version = test; | |
14 }else version(D_InlineAsm_X86_64){ | |
15 version = test; | |
16 }else{ | |
17 static assert(0, "DSTRESS{XFAIL}: no x86 inline asm support"); | |
18 } | |
19 | |
20 version(test){ | |
21 int a(X...)(X x){ | |
22 int i = 0xAB_CD_EF_12; | |
1605
392a442e2d64
Use tuple value instead of tuple type as asm arg!
Christian Kamm <kamm incasoftware de>
parents:
1425
diff
changeset
|
23 alias x[0] var1; |
1425 | 24 asm { |
25 mov EAX, var1; | |
26 inc EAX; | |
27 mov i, EAX; | |
28 } | |
29 return i; | |
30 } | |
31 | |
32 int main(){ | |
33 if(4 != a(3)){ | |
34 assert(0); | |
35 } | |
36 return 0; | |
37 } | |
38 } |