annotate run/a/asm_offset_01_A.d @ 1545:111a9895f863

[Issue 1334] Missing closing bracket in asm_offset_01_A, line 37 Russ Lewis <webmaster@villagersonline.com> 2007-07-11
author thomask
date Mon, 23 Jul 2007 18:36:35 +0000
parents 596115f20776
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1024
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
1 // $HeadURL$
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
2 // $Date$
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
3 // $Author$
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
4
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
5 // @author@ <lugaidster@gmail.com>
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
6 // @date@ 2006-04-28
1319
81222734adf3 sed'ed replacement of new:...http.d.puremagic.co... with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents: 1265
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=116
1024
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
8
1427
596115f20776 fixed #1042
thomask
parents: 1319
diff changeset
9 // __DSTRESS_TORTURE_BLOCK__ -fPIC
596115f20776 fixed #1042
thomask
parents: 1319
diff changeset
10
1024
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
11 module dstress.run.a.asm_offset_01_A;
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
12
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
13 version(D_InlineAsm_X86){
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
14 version = runTest;
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
15 }else version(D_InlineAsm_X86_64){
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
16 version = runTest;
1427
596115f20776 fixed #1042
thomask
parents: 1319
diff changeset
17 }else{
596115f20776 fixed #1042
thomask
parents: 1319
diff changeset
18 static assert(0, "DSTRESS{XFAIL}: no inline x86 asm support");
1024
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
19 }
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
20
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
21 version(runTest){
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
22 byte b;
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
23
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
24 int main(){
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
25 void* x = &b;
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
26 void* y;
1044
03c97933de98 inline ASM review
thomask
parents: 1024
diff changeset
27
1024
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
28 static if(size_t.sizeof == 4){
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
29 asm{
1265
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1083
diff changeset
30 mov EAX, offset b;
1024
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
31 mov y, EAX;
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
32 }
1427
596115f20776 fixed #1042
thomask
parents: 1319
diff changeset
33 }else static if(size_t.sizeof == 8){
596115f20776 fixed #1042
thomask
parents: 1319
diff changeset
34 asm{
596115f20776 fixed #1042
thomask
parents: 1319
diff changeset
35 mov RAX, offset b;
596115f20776 fixed #1042
thomask
parents: 1319
diff changeset
36 mov y, RAX;
1545
111a9895f863 [Issue 1334] Missing closing bracket in asm_offset_01_A, line 37
thomask
parents: 1427
diff changeset
37 }
1024
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
38 }else{
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
39 pragma(msg, "DSTRESS{ERROR}: unsupported pointer size");
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
40 static assert(0);
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
41 }
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
42
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
43 if(x != y){
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
44 assert(0);
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
45 }
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
46
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
47 return 0;
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
48 }
adf31c7a5127 Inline Assembler offset keyword
thomask
parents:
diff changeset
49 }