comparison run/t/tuple_23_C.d @ 1513:45c339264b57

[Issue 1125] Segfault using tuple in asm code, when size not specified Don Clugston <clugdbug@yahoo.com.au> 2007-04-11 http://d.puremagic.com/issues/show_bug.cgi?id=1125
author thomask
date Mon, 23 Apr 2007 18:09:16 +0000
parents
children
comparison
equal deleted inserted replaced
1512:b171e38c078b 1513:45c339264b57
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 // @author@ Don Clugston <clugdbug@yahoo.com.au>
6 // @date@ 2007-04-11
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1125
8 // @desc@ [Issue 1125] Segfault using tuple in asm code, when size not specified
9
10 module dstress.run.t.tuple_23_C;
11
12 version(D_InlineAsm_X86){
13 version = test;
14 }else version(D_InlineAsm_X86_64){
15 version = test;
16 }
17
18 version(test){
19 struct S{
20 int a;
21 int b;
22 }
23
24 int foo(X...)(X expr){
25 int i;
26 asm{
27 mov EAX, expr[0].a;
28 mov i, EAX;
29 }
30 return i;
31 }
32
33 const S s = {3, 0xCAFFEE};
34
35 int main(){
36
37 if(3 != foo(s)){
38 assert(0);
39 }
40 return 0;
41 }
42 }else{
43 static assert(0, "DSTRESS{XFAIL}: no inline X86 ASM support");
44 }