Mercurial > projects > dstress
comparison run/a/asm_04_D.d @ 1495:7a686112b047
[Issue 1172] Inline assembler: cannot access member of templated aggregate directly
Matti Niemenmaa <deewiant@gmail.com>
2007-04-21
http://d.puremagic.com/issues/show_bug.cgi?id=1172
author | thomask |
---|---|
date | Mon, 23 Apr 2007 17:54:56 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1494:f39a9d671323 | 1495:7a686112b047 |
---|---|
1 // $HeadURL$ | |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ Matti Niemenmaa <deewiant@gmail.com> | |
6 // @date@ 2007-04-21 | |
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1172 | |
8 // @desc@ [Issue 1172] Inline assembler: cannot access member of templated aggregate directly | |
9 | |
10 module dstress.run.a.asm_04_D; | |
11 | |
12 version(D_InlineAsm_X86){ | |
13 version = runTest; | |
14 }else version(D_InlineAsm_X86_64){ | |
15 version = runTest; | |
16 }else{ | |
17 static assert(0, "DSTRESS{XFAIL}: no inline ASM support"); | |
18 } | |
19 | |
20 version(runTest){ | |
21 union Foo(T){ | |
22 int a; | |
23 } | |
24 | |
25 int main(){ | |
26 int bar; | |
27 | |
28 Foo!(int) foo; | |
29 foo.a = 0xFEDC_BA09; | |
30 | |
31 asm{ | |
32 lea EAX, foo; | |
33 mov ECX, Foo!(int).a[EAX]; | |
34 mov bar, ECX; | |
35 } | |
36 | |
37 if(0xFEDC_BA09 != bar){ | |
38 assert(0); | |
39 } | |
40 | |
41 return 0; | |
42 } | |
43 } |