annotate run/a/asm_naked_01.d @ 1572:169ba9b6cb5d

[Issue 1013] Invalid code generated for naked functions with (u)long arguments <madou@madou.org> 2007-03-01 http://d.puremagic.com/issues/show_bug.cgi?id=1013
author thomask
date Thu, 21 Feb 2008 15:18:50 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1572
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
1 // $HeadURL$
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
2 // $Date$
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
3 // $Author$
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
4
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
5 // @author@ <madou@madou.org>
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
6 // @date@ 2007-03-01
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1013
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
8 // @desc@ [Issue 1013] Invalid code generated for naked functions with (u)long arguments
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
9
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
10 module dstress.run.a.asm_naked_01;
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
11
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
12 version(D_InlineAsm_X86){
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
13 version(GNU){
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
14 const RET_SIZE = 0;
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
15 }else{
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
16 const RET_SIZE = 8;
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
17 }
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
18 long test(long l){
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
19 asm{
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
20 naked;
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
21 mov EDX, [ESP+0x8];
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
22 mov EAX, [ESP+0x4];
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
23 add EAX, 0x1;
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
24 adc EDX, 0x1;
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
25 ret RET_SIZE;
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
26 }
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
27 }
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
28
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
29 int main(){
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
30 if(0x1234_567A_0000_0000 != test(0x1234_5678_FFFF_FFFF)){
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
31 assert(0);
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
32 }
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
33
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
34 return 0;
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
35 }
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
36 }else{
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
37 pragma(msg, "DSTRESS{XFAIL}: no matching inline ASM support");
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
38 static assert(0);
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
39 }
169ba9b6cb5d [Issue 1013] Invalid code generated for naked functions with (u)long arguments
thomask
parents:
diff changeset
40