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